I was doing some testing on an app, and I realized that calling .state() on a Deferred object seem to launch .done() callback again and again.
I produce a reduced test case here
http://jsfiddle.net/vaxilart/ajeGm/
I was wondering if this is a normal behavior or if I misunderstand something.
Thank you in advance !
You’re jsfiddle is not demonstrating what you want it to. Instead of re-executing the anonymous IIFE, you’re re-executing all of the code in global scope including the resolve() over and over again. I think the modified version of the fiddle illustrates that calling .state() does nothing but returns the state.
http://jsfiddle.net/ajeGm/4/