Skip to content

Instantly share code, notes, and snippets.

@siassaj
Created December 11, 2018 13:01
Show Gist options
  • Select an option

  • Save siassaj/5412035344b84b2f8b6030bf086dddb3 to your computer and use it in GitHub Desktop.

Select an option

Save siassaj/5412035344b84b2f8b6030bf086dddb3 to your computer and use it in GitHub Desktop.
mix({
foo: {
bacon: 'stuff'
},
baz: {
bacon: 123,
lettuce: 'what'
}
}, {
bacon: ({foo: string, baz: number}): void => {},
// bacon: ({foo: string, baz: string}): void => {} doesn't work because baz's bacon was given as a number
lettuce: ({foo: undefined, baz: string}): void => {}
// lettuce: ({foo: string, baz: string}): void => {} doesn't work as foo's lettuce is not there
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment