MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / createTypes

Function createTypes

client/src/utils/create-types.ts:16–24  ·  view source on GitHub ↗
(types: string[], ns: string)

Source from the content-addressed store, hash-verified

14 * @returns {object} Object with action types.
15 */
16export function createTypes(types: string[], ns: string): ActionTypes {
17 return types.reduce(
18 (types, action: string) => ({
19 ...types,
20 [action]: `${ns}.${action}`
21 }),
22 {}
23 );
24}
25
26/**
27 * Creates an array with action names.

Callers 7

index.jsFile · 0.90
index.jsFile · 0.90
action-types.jsFile · 0.90
action-types.jsFile · 0.90
action-types.jsFile · 0.90
gatsby-node.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected