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

Merge values and handlers in fork #1068

Open
zerobias opened this issue May 21, 2024 · 0 comments
Open

Merge values and handlers in fork #1068

zerobias opened this issue May 21, 2024 · 0 comments
Labels
discussion fork api RFC Request for Comments

Comments

@zerobias
Copy link
Member

Proposal

Merge values and handlers in fork to single property. Effector can choose between store and effect automatically, so possibly we can merge them to single property.

fork({
  fill: [
    [$foo, 'foo'],
    [$bar, 1],
    [requestFx, () => null],
    [getUsersFx, () => []]
  ]
})

Pros: easier to use, like useStore and useEvent was merged to useUnit
Cons: another breaking change, benefits of merge not obvious, as many people still write useUnit(stores) and useUnit(eventsOrEffect) in two calls to preserve semantic distinction

Not sure which property name could be used and whether we need to go in this direction so I create this issue to remember that we have this option

@zerobias zerobias added RFC Request for Comments discussion fork api labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion fork api RFC Request for Comments
Projects
None yet
Development

No branches or pull requests

1 participant