Can external events be bound (binded?) to state or...
# mvikotlin
i
Can external events be bound (binded?) to state or intent? So for instance, imagine you are subscribed to some sort of event over the network that should update your state.
a
Sure. You can either bind them to Store Intents or subscribe to the source internally (e.g. in the Bootstrapper). I usually prefer the former way.
i
Would you create the external event as some sort of Event? Or just any old object.
a
Probably network events are already well typed, just bind them to Intents via a mapper.
Like
bind(...) { networkEvents.map(...) bindTo store }
i
👍