Skip to content

Instantly share code, notes, and snippets.

@mauriciosoares
Created September 21, 2015 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauriciosoares/e22a4b6108af272986ca to your computer and use it in GitHub Desktop.
Save mauriciosoares/e22a4b6108af272986ca to your computer and use it in GitHub Desktop.
Composition example
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