MCPcopy
hub / github.com/redux-loop/redux-loop / action

Function action

src/cmd.js:268–284  ·  view source on GitHub ↗
(actionToDispatch)

Source from the content-addressed store, hash-verified

266}
267
268function action(actionToDispatch) {
269 if (process.env.NODE_ENV !== 'production') {
270 throwInvariant(
271 typeof actionToDispatch === 'object' &&
272 actionToDispatch !== null &&
273 typeof actionToDispatch.type !== 'undefined',
274 'Cmd.action: first argument and only argument to Cmd.action must be an action'
275 );
276 }
277
278 return Object.freeze({
279 [isCmdSymbol]: true,
280 type: cmdTypes.ACTION,
281 actionToDispatch,
282 simulate: simulateAction,
283 });
284}
285
286function clearTimeoutCmd(timerId) {
287 return run(clearTimeout, { args: [timerId] });

Callers 1

dispatchFunction · 0.85

Calls 1

throwInvariantFunction · 0.90

Tested by

no test coverage detected