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

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

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

Parameters

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

Returns

WritableAtom<Data, [Data], void>

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>>