bcherny/undux

Functional updater form for store.set()

Open

#103 opened on Feb 7, 2020

View on GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (33 forks)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (1,551 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

store.set() should support the functional form, as per https://reactjs.org/docs/hooks-reference.html#functional-updates, in order update the state based on an instruction, instead of the current value (which may be out of date in an async scenario).

Contributor guide