Created
September 21, 2015 21:22
-
-
Save mauriciosoares/e22a4b6108af272986ca to your computer and use it in GitHub Desktop.
Composition example
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
let barker = (state) => ({ | |
bark: () => console.log(`woof ${state.name}`) | |
}); | |
let machine = (name) => { | |
let state = { | |
name | |
} | |
return Object.assign({}, | |
barker(state) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment