Skip to content

Instantly share code, notes, and snippets.

@nertzy
Created May 2, 2017 21:38
Show Gist options
  • Save nertzy/a08b62660a00b668edf7ca858d218b56 to your computer and use it in GitHub Desktop.
Save nertzy/a08b62660a00b668edf7ca858d218b56 to your computer and use it in GitHub Desktop.
export function generateFactory<T>(defaultObject: T): (input?: Partial<T>) => T {
return (input?: Partial<T>) => Object.assign({}, defaultObject, input);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment