Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/jotai/src/vanilla/utils/atomWithObservable.ts>atomWithObservable

👻 Primitive and flexible state management for React
Latest
function atomWithObservable
import { atomWithObservable } from "https://deno.land/x/jotai@v2.10.2/src/vanilla/utils/atomWithObservable.ts";

Parameters

getObservable: (get: Getter) => SubjectLike<Data>
options: OptionsWithInitialValue<Data>

Parameters

getObservable: (get: Getter) => SubjectLike<Data>
optional
options: Options<Data>

Returns

WritableAtom<Data | Promise<Data>, [Data], void>

Parameters

getObservable: (get: Getter) => ObservableLike<Data>
options: OptionsWithInitialValue<Data>

Parameters

getObservable: (get: Getter) => ObservableLike<Data>
optional
options: Options<Data>

Returns

Atom<Data | Promise<Data>>