- Notifications
You must be signed in to change notification settings - Fork47
Open
Description
Often pieces of state will be needed for decisions in the effect methods. Would you recommend keeping these instead in an external useState, or is there some way to pass these in via events (without changing state).
for instance, in xstate you can do something like this:
{ states: { start: { on: { readCountChange: { actions: [assign((context, event)=>{ return { readsExist: event.readCount > 0}})] } } ... }}And then use that readsExist later in a condition to decide if some other event should be allowed to make a state change.
Metadata
Metadata
Assignees
Labels
No labels