You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi,I looked through the docs about Reflux.listenTo's usages in here and find that there are two arguments:one is listenable,the other is callback,but later I find out that there exists a third argument meaning defaultCallback ,I can't find related docs ,only this pr : pr.
My problem is :what's the usage of defaultCallback,when to call this function and is there any ducuments to refer to?Thank you 😃
The text was updated successfully, but these errors were encountered:
listenTo is made of function(listenable,callback,defaultCallback){
Where if defaultCallback exists it goes and fetches the initial state (fetchInitialState) from the listenable, and feeds the data back into defaultCallback
And fetchInitialState has the next explanation:
/**
* Used in `listenTo`. Fetches initial data from a publisher if it has a `getInitialState` method.
* @param {Action|Store} listenable The publisher we want to get initial state from
* @param {Function|String} defaultCallback The method to receive the data
*/
So if the store you are about to listen to, has the getInitialState , you can pass defaultCallback to grab the data retuned from getInitialState and do something with it.
hi,I looked through the docs about Reflux.listenTo's usages in here and find that there are two arguments:one is listenable,the other is callback,but later I find out that there exists a third argument meaning defaultCallback ,I can't find related docs ,only this pr : pr.
My problem is :what's the usage of defaultCallback,when to call this function and is there any ducuments to refer to?Thank you 😃
The text was updated successfully, but these errors were encountered: