So I understand we can do something like this:
Collection.fetch({success: function() { bla.. } } )
But say I wanted something like this:
Collection.fetch( { success: function () {
if (condition)
{ this.fetch() } }})
The problem is, the second time I call fetch (the one in bold), it won’t have the success function associated with it. What I want to do is: Call fetch until that condition becomes true…that condition is based on the data (result) of the previous fetch.
Anyone?
You could declare the function outside of the parameter like so, this way you can reference it later.