Function
_create_dispatcher
(
reducer: Callable[[_Type, _ActionType], _Type],
set_state: Callable[[Callable[[_Type], _Type]], None],
)
Source from the content-addressed store, hash-verified
| 317 | |
| 318 | |
| 319 | def _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]) |
Tested by
no test coverage detected