MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / generateActionFile

Function generateActionFile

tools/js/generate-store-logic.js:30–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28let originalMiddlewareIndexContent
29
30const generateActionFile = actionName => {
31 const actionNameUpperSnakeCase = camelCaseToUpperSnakeCase(actionName)
32 return `import createRequestActions from '@ttn-lw/lib/store/actions/create-request-actions'
33
34export const ${actionNameUpperSnakeCase}_BASE = '${actionNameUpperSnakeCase}'
35export const [
36 {
37 request: ${actionNameUpperSnakeCase},
38 success: ${actionNameUpperSnakeCase}_SUCCESS,
39 failure: ${actionNameUpperSnakeCase}_FAILURE,
40 },
41 {
42 request: ${actionName},
43 success: ${actionName}Success,
44 failure: ${actionName}Failure,
45 },
46] = createRequestActions(${actionNameUpperSnakeCase}_BASE, (params) => ({ ...params }))
47`
48}
49
50const generateReducerFile = (
51 storeFileName,

Callers 1

mainFunction · 0.85

Calls 1

Tested by

no test coverage detected