This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {ComponentType} from 'react'; | |
export default interface IAppDomId { | |
// Component: ComponentType<any>; // TODO: add when used with code splitting | |
Component: JSX.Element; | |
domId: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
module.exports = function({ env, paths }) { | |
return { | |
webpack: { | |
alias: { | |
environment: path.join(__dirname, 'src', 'environments', process.env.CLIENT_ENV) | |
} | |
}, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
module.exports = function override(config, env) { | |
config.resolve.alias = Object.assign({}, config.resolve.alias, { | |
environment: path.join(__dirname, 'src', 'environments', process.env.NODE_ENV) | |
}); | |
return config; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {camelCase, kebabCase, lowerCase, snakeCase, startCase, upperCase, upperFirst} from 'lodash'; | |
export default class StringUtility { | |
static toCamelCase(str) { | |
return camelCase(str); | |
} | |
static toTitleCase(str) { | |
return startCase(camelCase(str)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const numberArray = new Array(10).fill(1); | |
console.log(numberArray); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import StringUtility from "./StringUtility"; | |
import Util from "./Util"; | |
export default class PropertyNormalizerUtility { | |
static normalize(json) { | |
const dataOrEmptyObject = Boolean(json) ? json : {}; | |
// Makes all property names camelCase so they are consistent in the application. | |
// Also recursively goes through child objects. | |
return Util.clone(dataOrEmptyObject, StringUtility.toCamelCase); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ISomeThingReducerState from './models/ISomeThingReducerState'; | |
import IAction from '../IAction'; | |
import SomeThingAction, {SomeThingActionUnion} from './SomeThingAction'; | |
import OtherThingResponseModel from './models/OtherThingResponseModel'; | |
export default class SomeThingReducer { | |
private static readonly _initialState: ISomeThingReducerState = { | |
isLoadingOtherThing: false, | |
otherThing: null, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {generateTemplateFiles} = require('generate-template-files'); | |
generateTemplateFiles([ | |
// Example of generating multiple files | |
{ | |
option: 'Create Redux Store', | |
defaultCase: '(pascalCase)', | |
entry: { | |
folderPath: './tools/templates/', | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import I__store__ReducerState from './models/I__store__ReducerState'; | |
import IAction from '../IAction'; | |
import __store__Action, {__store__ActionUnion} from './__store__Action'; | |
import __model__ResponseModel from './models/__model__ResponseModel'; | |
export default class __store__Reducer { | |
private static readonly _initialState: I__store__ReducerState = { | |
isLoading__model__: false, | |
__model__(camelCase): null, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const typeError = (obj: any) => | |
new Error(`check()'s first argument must be a boolean but argument was of type ${typeof obj}`); | |
const isNotTypeBoolean = (arg: any) => typeof arg !== 'boolean'; | |
/** | |
* Helper function for throwing errors if a given expression evaluates to false. | |
* This function is strict and will throw an error the the type of the first | |
* argument is not "boolean". | |
*/ |