Skip to content

dtinth/reflux-waitfor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Bring Reflux closer to the original Flux

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors