alt icon indicating copy to clipboard operation
alt copied to clipboard

Document the magic that is linking actions to stores

Open noahmonster opened this issue 9 years ago • 1 comments
trafficstars

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!

noahmonster avatar Aug 02 '16 19:08 noahmonster

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).

jdlehman avatar Aug 05 '16 15:08 jdlehman