Releases: finom/use-change
Releases · finom/use-change
Add experimental waitForValue function
import { UNSAFE_waitForValue as waitForValue } from 'use-change';
// resolves once checkBoolean(value) returns true
// resolves immediately if predicate returns true initially
const value = await waitForValue(object, key, (value) => checkBoolean(value))
Support undefined and null as keys
const store = { x: 1 };
const [value] = useChange(store, 'x' as 'x' | null | undefined); // value is inferred as "number | undefined"
value + 1; // TS error
use-change also doesn't create ghost properties such as "null" or "undefined" anymore.
🚀 Remove useless overload
That's a breaking and clean-up update that removes an overload that wasn't useful after heavy testing in real work.
See the old documentation for more info.