MCPcopy Index your code
hub / github.com/reactive-python/reactpy / _create_dispatcher

Function _create_dispatcher

src/py/reactpy/reactpy/core/hooks.py:319–326  ·  view source on GitHub ↗
(
    reducer: Callable[[_Type, _ActionType], _Type],
    set_state: Callable[[Callable[[_Type], _Type]], None],
)

Source from the content-addressed store, hash-verified

317
318
319def _create_dispatcher(
320 reducer: Callable[[_Type, _ActionType], _Type],
321 set_state: Callable[[Callable[[_Type], _Type]], None],
322) -> Callable[[_ActionType], None]:
323 def dispatch(action: _ActionType) -> None:
324 set_state(lambda last_state: reducer(last_state, action))
325
326 return dispatch
327
328
329_CallbackFunc = TypeVar("_CallbackFunc", bound=Callable[..., Any])

Callers 1

use_reducerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected