Skip to content

Instantly share code, notes, and snippets.

@balkhaev
Last active September 1, 2016 21:56
Show Gist options
  • Save balkhaev/abad57b5eefdfe72f8af611eb11fbedb to your computer and use it in GitHub Desktop.
Save balkhaev/abad57b5eefdfe72f8af611eb11fbedb to your computer and use it in GitHub Desktop.
Fabrica for Machine,js
import Machine from 'machine.js'
import StateMachine from 'stateMachine.js'
import ViewStateMachine from 'viewStateMachine.js'
const fabrica = new Fabrica({
details: [ storeDetail, domDetail, lodashDetail, restDetail ],
components: [ flashbackComponent, spectatorComponent, apinatorComponent ],
mechanisms: [ ],
machnies: {
ViewStateMachine,
StateMachine,
Machine
}
})
fabrica.addRecipe({
name: 'frontendMachine',
machine: 'StateMachine'
elements: {
details: 'store, dom', // details.split(',').map(detailName => detailName.trim() + 'Detail')
components: 'flashback, spectator, apinator'
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment