Created
November 26, 2018 09:11
-
-
Save ragmha/a99b22aeabe1461289866d65a8a8bc07 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
type Size = "small" | "medium" | "large"; | |
type Callback = (size: Size) => void; | |
let pizzaSize: Size = "small"; | |
const selectSize: Callback = x => (pizzaSize = x); | |
selectSize("medium"); | |
console.log(`Pizza size: ${pizzaSize}`); | |
selectSize("small"); | |
console.log(`Pizza size: ${pizzaSize}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment