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

Function addTodoIfEmpty

test/helpers/actionCreators.ts:27–33  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

25}
26
27export function addTodoIfEmpty(text: string) {
28 return (dispatch: Dispatch, getState: () => any) => {
29 if (!getState().length) {
30 dispatch(addTodo(text))
31 }
32 }
33}
34
35export function dispatchInMiddle(boundDispatchFn: () => void) {
36 return {

Callers 1

Calls 3

getStateFunction · 0.85
addTodoFunction · 0.70
dispatchFunction · 0.50

Tested by

no test coverage detected