Skip to content

StoreKeeper

Artem Shurygin edited this page Jan 21, 2020 · 2 revisions

StoreKeeper is a Redux like state container.

StoreKeeper can create Store that keeps state and subscribers.

class CountState {
    int count
}

class PlusOne implements Action {
}

def countStore = StoreKeeper.storeBuilder(CountState.class)
        .withInitial(new CountState(count: 0))
        .withReducer({ action, state ->
            if(action instanceof PlusOne) {
                return new CountState(count: state.count + 1)
            }
            return state
        })
        .persistence(1)
        .build()

dev subscription = countStore.subscribe({ state ->
    // State changed
})

countStore.dispatch(new PlusOne())

subscription.unsubscribe()

Core

Protocols

  • HTTP
  • Websocket server
  • Websocket client
  • OSC

Modules

  • Interfaces
  • Integrations
    • OBS
    • Streamlabs Socket API
    • Twitch OAuth
    • Twitch MI
    • Twitch Bot
    • Twitch PubSub
    • X32/M32 Mixer
    • YMPD
Clone this wiki locally