Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

flux-shri

rozov121ISC1.0.4TypeScript support: included

Dispatcher sh const dispatcher = new Dispatcher() #### Methods - subscribeStore(store) - подписать store на получение событий - dispatch(action) - отправить action в store

readme

API

Dispatcher

const dispatcher = new Dispatcher()

Methods

  • subscribeStore(store) - подписать store на получение событий
  • dispatch(action) - отправить action в store

Store

const store = new Store(actions, state)

Methods

  • sgetState() - получить текущий state

createAction

createAction(action, payload)

Usage

import flux from 'flux-shri'

const dispatcher = new flux.Dispatcher()
const store = new flux.Store(actions, state)
const createAction = flux.createAction

dispatcher.subscribeStore(store)

dispatcher.dispatch(createAction('SET_VOLUME', { volume: 50 }))

unit tests

$ npm i
$ npm test

smart-home