* Default Dispatch type accepts any object with `type` property.
()
| 4 | * Default Dispatch type accepts any object with `type` property. |
| 5 | */ |
| 6 | function 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. |
nothing calls this directly
no test coverage detected