Raynos / mercury

A truly modular frontend framework
http://raynos.github.io/mercury/
MIT License
2.82k stars 143 forks source link

Add example of asynchronous updating of state #170

Closed aknuds1 closed 9 years ago

aknuds1 commented 9 years ago

Add an example of updating state in response to an asynchronous event.

I've written this example, since I was confused when learning Mercury as to how to update state in response to an event that doesn't emanate from the UI (e.g. when an Ajax request finishes).

Note that npm test fails for me due to linting errors, but it also fails without my modifications, so I don't know if there's something wrong with my setup or what.

Raynos commented 9 years ago

lgtm :)

aknuds1 commented 9 years ago

@Raynos Thanks! Wondering if this example should make it into tests? I noticed that other examples had corresponding tests.

Raynos commented 9 years ago

if its an easy example you can write a test