Skip to content

Releases: finom/use-change

Add experimental waitForValue function

13 Jun 14:34
Compare
Choose a tag to compare
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

02 Jun 15:41
Compare
Choose a tag to compare
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

08 Nov 17:29
Compare
Choose a tag to compare

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.