Created
May 21, 2016 19:10
-
-
Save silviogutierrez/01e22a741b6822ec8925116b0d34231b to your computer and use it in GitHub Desktop.
This file contains 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
function decorateEntrySnippet<Additions, I>(someFunctionThatReturnsAdditions: () => Additions, toDecorate: (props: I) => void) { | |
function inside(props: I & Additions) { | |
return toDecorate(props); | |
} | |
return inside; | |
} | |
function EntrySnippet(props: {entry: Entry}): void { | |
} | |
const generateAdditions = () => { | |
return { | |
entry: 'Clearly this should not work', | |
}; | |
} | |
const DecoratedEntrySnippet = decorateEntrySnippet(generateAdditions, EntrySnippet); | |
let myEntry: Entry = null; | |
let myMeal: Meal = null; | |
EntrySnippet({entry: myEntry}) | |
DecoratedEntrySnippet({entry: myEntry}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment