MCPcopy
hub / github.com/reduxjs/redux / simple

Function simple

test/typescript/dispatch.ts:6–17  ·  view source on GitHub ↗

* Default Dispatch type accepts any object with `type` property.

()

Source from the content-addressed store, hash-verified

4 * Default Dispatch type accepts any object with `type` property.
5 */
6function simple() {
7 const dispatch: Dispatch = null as any
8
9 const a = dispatch({ type: 'INCREMENT', count: 10 })
10
11 a.count
12 // @ts-expect-error
13 a.wrongProp
14
15 // @ts-expect-error
16 dispatch('not-an-action')
17}
18
19/**
20 * Dispatch accepts type argument that restricts allowed action types.

Callers

nothing calls this directly

Calls 1

dispatchFunction · 0.50

Tested by

no test coverage detected