Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Question] How to update context without changing state? #87

Open
@DaveWelling

Description

@DaveWelling

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp