javascript - Reactjs: wait for parameters before requesting data -


i'm using flux pattern retrieve data in single call using action gets passed on store. more details can found below along pseudo code.

the scenario follows: components on page pass category parameter action, e.g. retrieving labels during componentwillmount method.

the code below called different components on page using different parameter.

componentwillmount: function() {    initializeactions.addcategory('c1'); }, 

i want retrieve data server making single call parameters (e.g. during componentdidmount event).

initializedata: function() {    dataservice.loadlabels(categories);    //dispatch loaded event store } 

the problem not parameters/categories added before initialize function gets called. how can ensure parameters have been added before making server call?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -