-
Notifications
You must be signed in to change notification settings - Fork 0
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()
- HTTP
- Websocket server
- Websocket client
- OSC
- Interfaces
- Integrations
- OBS
- Streamlabs Socket API
- Twitch OAuth
- Twitch MI
- Twitch Bot
- Twitch PubSub
- X32/M32 Mixer
- YMPD