GitHub

FnContext

API reference for FnContext.

What a function atom's function gets (Effect's FnContext): its reads do not make the atom depend on anything.

Attributes

AttributeTypeDescription
registryAtomRegistryService

Functions

__call__

__call__[A](atom) -> A
ParameterTypeDescription
atomAtom[A]

Returns A

def __call__[A](self, atom: Atom[A], /) -> A: ...

result

result[A, E](atom, /, *, suspend_on_waiting=False) -> Effect[A, E]
ParameterTypeDescription
atomAtom[AsyncResult[A, E]]
suspend_on_waitingbool = False

Returns Effect[A, E]

def result[A, E](
    self, atom: Atom[AsyncResult[A, E]], /, *, suspend_on_waiting: bool = False
) -> Effect[A, E]: ...

add_finalizer

add_finalizer(f) -> None
ParameterTypeDescription
fCallable[[], None]
def add_finalizer(self, f: Callable[[], None], /) -> None: ...

mount

mount(atom) -> None
ParameterTypeDescription
atomAtom[Any]
def mount(self, atom: Atom[Any], /) -> None: ...

refresh

refresh(atom) -> None
ParameterTypeDescription
atomAtom[Any]
def refresh(self, atom: Atom[Any], /) -> None: ...

self

self() -> Option[Any]

Returns Option[Any]

def self(self) -> Option[Any]: ...

set_self

set_self(value) -> None
ParameterTypeDescription
valueAny
def set_self(self, value: Any, /) -> None: ...

set

set[W](atom, value) -> None
ParameterTypeDescription
atomWritable[Any, W]
valueW
def set[W](self, atom: Writable[Any, W], value: W, /) -> None: ...

set_result

set_result[A, E, W](atom, value) -> Effect[A, E]
ParameterTypeDescription
atomWritable[AsyncResult[A, E], W]
valueW

Returns Effect[A, E]

def set_result[A, E, W](
    self, atom: Writable[AsyncResult[A, E], W], value: W, /
) -> Effect[A, E]: ...

some

some[A](atom) -> Effect[A]
ParameterTypeDescription
atomAtom[Option[A]]

Returns Effect[A]

def some[A](self, atom: Atom[Option[A]], /) -> Effect[A]: ...

stream

stream[A](atom, /, *, without_initial_value=False) -> Stream[A]
ParameterTypeDescription
atomAtom[A]
without_initial_valuebool = False

Returns Stream[A]

def stream[A](self, atom: Atom[A], /, *, without_initial_value: bool = False) -> Stream[A]: ...

stream_result

stream_result[A, E](atom, /, *, without_initial_value=False) -> Stream[A, E]
ParameterTypeDescription
atomAtom[AsyncResult[A, E]]
without_initial_valuebool = False

Returns Stream[A, E]

def stream_result[A, E](
    self, atom: Atom[AsyncResult[A, E]], /, *, without_initial_value: bool = False
) -> Stream[A, E]: ...

subscribe

subscribe[A](atom, f, /, *, immediate=False) -> None
ParameterTypeDescription
atomAtom[A]
fCallable[[A], None]
immediatebool = False
def subscribe[A](
    self, atom: Atom[A], f: Callable[[A], None], /, *, immediate: bool = False
) -> None: ...