Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Created February 13, 2018 00:06
Show Gist options
  • Save ajcrites/3c76a8f89d0d9c93a89dbb79ea7f1c0c to your computer and use it in GitHub Desktop.
Save ajcrites/3c76a8f89d0d9c93a89dbb79ea7f1c0c to your computer and use it in GitHub Desktop.
export interface Screen {
screen: string;
}
export interface ResetScreen<T> extends Screen {
passProps?: T;
}
export interface PushedScreen<T> extends ResetScreen<T> {
}
interface BioProps {
username: string;
}
function push<T>(params: PushedScreen<T>) {
return params.passProps;
}
push<BioProps>({ screen: 'hi', passProps: { username: 'hi' } });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment