1.0.1 • Published 9 years ago

reflux-waitfor v1.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

reflux-waitfor Build Status

This project implements Reflux.waitFor(AnotherStore) that works like Dispatcher.waitFor().

Usage

const Reflux = require('reflux')

require('reflux-waitfor').install(Reflux)

In store action handlers:

const UnreadCountStore = Reflux.createStore({
  // ...

  onMessageReceive (data) {
    Reflux.waitFor(MessageStore)
    this.count = MessageStore.getAllMessages().filter(isUnread).length
    this.trigger()
  },

  // ...

See example.js for more example.

See test.js for even more example.

LICENSE

MIT