mocking - Init function isn't calling when Reflux.createStore -


i have mocked store

var action = reflux.createaction('action'); var mockfn = jest.genmockfn();  var store = reflux.createstore({     init: function () {         console.log("init mock");         this.listento(action, this.onaction);     },     onaction: function () {         mockfn();     } });  export default store; 

and when component try listen store

componentdidmount = () => {    ...    const deregstorelistener = conceptstore.listen(     ({nodes,centroids}) => {       ...     }   ) } 

it throw error

typeerror: _index2.default.listen not function

the strange behavior init function wasn't called. reflux.createstore didn't created store properly. why?


Comments

Popular posts from this blog

Sass watch command compiles .scss files before full sftp upload -

filehandler - java open files not cleaned, even when the process is killed -

gridview - Yii2 DataPorivider $totalSum for a column -