1.0.4 • Published 6 years ago

flux-shri v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

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

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago