Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.set in addition to .update #80

Open
VKBobyr opened this issue Feb 5, 2022 · 0 comments
Open

.set in addition to .update #80

VKBobyr opened this issue Feb 5, 2022 · 0 comments

Comments

@VKBobyr
Copy link

VKBobyr commented Feb 5, 2022

Is your feature request related to a problem? Please describe.
Whenever I want to transition to a new flow state without caring about the current flow state, I don't want to write more code of the form:

context
    .flow<StateClass>()
    .update((currentStateIDontCareAbout) => NewState())

Describe the solution you'd like
I'd like to see a more consise version of the form:

context
    .flow<StateClass>()
    .set(NewState())

This isn't a big deal -- just seems like a natural function to have.

PS.
I know I can use .update((_) => NewState()) to make it more concise, but I'd just pass in the state directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant