8000 Missed update when store returns to default state · Issue #1199 · effector/effector · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Missed update when store returns to default state #1199

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

Open
zerobias opened this issue Dec 13, 2024 · 0 comments
Open

Missed update when store returns to default state #1199

zerobias opened this issue Dec 13, 2024 · 0 comments
Labels
breaking changes bug Something isn't working fork api

Comments

@zerobias
Copy link
Member

When derived store with non-default value in scope due to values definition returns to default one during the first store update in that scope, this update is ignored

const trigger = createEvent()

const $store1 = createStore('')
const $store2 = createStore('')

const $derivedStore = $store1.map(val => val)

$store1.on(trigger, (_, upd) => upd)
$store2.on($derivedStore, (_, upd) => upd)

const scope = fork({
  values: [[$store1, '1']]
})

await allSettled(trigger, {scope, params: ''})

scope.getState($store2)
// => 1

This will change how applications work, so this is a breaking change

@zerobias zerobias added bug Something isn't working breaking changes fork api labels Dec 13, 2024
@zerobias zerobias added this to the effector Neowise 24 milestone Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking changes bug Something isn't working fork api
Projects
None yet
Development

No branches or pull requests

1 participant
0