@embra/reactivity - v0.0.4
    Preparing search index...

    Variable useValueConst

    useValue: UseValue = ...

    Accepts a ReadableLike and returns the latest value. It only triggers re-rendering when new value emitted from $ (base on Readable.version instead of React's Object.is comparison).

    A ReadableLike.

    An optional Scheduler to control the update frequency. If not provided, updates are applied synchronously.

    the value of the ReadableLike, or $ itself if $ is not a ReadableLike

    import { useValue } from "@embra/reactivity/react";

    function App({ count$ }) {
    const count = useValue(count$);
    return <div>{count}</div>;
    }
    import { useValue, MicrotaskScheduler } from "@embra/reactivity/react";

    function App({ rapidChangeCount$ }) {
    const count = useValue(rapidChangeCount$, MicrotaskScheduler); // update at most once per microtask
    return <div>{count}</div>;
    }