Skip to content

Instantly share code, notes, and snippets.

@piotrwitek
Created January 14, 2017 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piotrwitek/aa6607d3f19f508f58a0912c76c32ef2 to your computer and use it in GitHub Desktop.
Save piotrwitek/aa6607d3f19f508f58a0912c76c32ef2 to your computer and use it in GitHub Desktop.
Object.assign for type-safe partial state updates
/**
* @export Object.assign for type-safe partial state updates
* @interface ObjectConstructor
*/
export interface ObjectConstructor {
assign<T>(targetState: {}, sourceState: T, ...partialStates: Partial<T>[]): T;
}
export declare const Object: ObjectConstructor;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment