goatslacker / alt

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

Document the magic that is linking actions to stores #671

Open noahmonster opened 8 years ago

noahmonster commented 8 years ago

Hi,

I have been looking at the testing stores example and the associated repository. Conceptually, I think these are very good examples.

I ran into a bit of an issue when I then tried to use this documentation to test my own stores. I was trying to dispatch an event using:

 alt.dispatcher.dispatch({action: MyActions.someAction, data: {} });

This wasn't working.

I eventually discovered that I instead need to pass "action: MyActions.SOME_ACTION" instead of "MyActions.someAction" and everything started working.

I'd like to request that these special keys (MyActions.SOME_ACTION) that point to action functions be made more clear in the documentation. It would have saved me a lot of time if this was explained in the testing stores example. It would also be nice to have this explained in the Actions class documentation.

Thanks!

jdlehman commented 8 years ago

Here is where these constants are referenced in the docs. Feel free to create a PR if you find anything unclear (or difficult to find).