Const
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).
Object.is
A ReadableLike.
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>;} Copy
import { useValue } from "@embra/reactivity/react";function App({ count$ }) { const count = useValue(count$); return <div>{count}</div>;}
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).