saealib.core.StateView#

class saealib.core.StateView(store, reads, *, context=None, dispatch=None)[ソース]#

ベースクラス: object

Read-only projection of a store for declared state keys.

パラメータ:
  • store (StateStore)

  • reads (Iterable[StateKey] | StateContract)

  • context (object | None)

  • dispatch (Callable[[object], None] | None)

Methods

__init__

contains

Return presence for a declared key.

dispatch

Dispatch a component event through the bound runtime callback.

get

Return a declared value, making arrays read-only for the caller.

Method Details

StateView.__init__(store, reads, *, context=None, dispatch=None)[ソース]#
パラメータ:
  • store (StateStore)

  • reads (Iterable[StateKey] | StateContract)

  • context (object | None)

  • dispatch (Callable[[object], None] | None)

戻り値の型:

None

StateView.contains(key)[ソース]#

Return presence for a declared key.

パラメータ:

key (StateKey)

戻り値の型:

bool

StateView.dispatch(event)[ソース]#

Dispatch a component event through the bound runtime callback.

パラメータ:

event (object)

戻り値の型:

None

StateView.get(key)[ソース]#

Return a declared value, making arrays read-only for the caller.

パラメータ:

key (StateKey[ValueT])

戻り値の型:

ValueT