goatslacker / alt

Isomorphic flux implementation
http://alt.js.org/
3.45k stars 323 forks source link

Actions class in undefined in store when it's loaded before store #586

Closed vedmant closed 8 years ago

vedmant commented 8 years ago

I'm new to FrontEnd development, but I noticed one strange thing, I was trying to understand why I can't bindActions in store, it looks like there is some dependency in which order files are imported. Here is my UserStore http://screencast.com/t/mypbB1fK , and here is my component http://screencast.com/t/8unMqwQvk6U. UserStore is used in different component, which is loaded after this one. The problem is that UserActions is undefined in UserStore until I put UserStore import in that first component before UserActions import, http://screencast.com/t/WjjhF2bKaGlK .

BTW, bindActions store method doesn't throw any error if it gets undefined value, this slowed me down in finding why store methods and not triggered.

vedmant commented 8 years ago

Sorry, It just was my mistake, I duplicated action class name in different file.