Skip to content

Instantly share code, notes, and snippets.

@bodia-uz
Last active November 16, 2018 12:56
Show Gist options
  • Save bodia-uz/6b26868496c839e25fb6c0ba3741835b to your computer and use it in GitHub Desktop.
Save bodia-uz/6b26868496c839e25fb6c0ba3741835b to your computer and use it in GitHub Desktop.
Root
Root
Inactive*
reviewRegions -> Regions
reviewTwoOptions -> TwoOptions
Active
Question
Regions
RegionsReview*
close -> Inactive
edit -> RegionsEdit
answer -> ThankU
RegionsEdit
cancel -> RegionsReview
submit -> ThankU
TwoOptions
TwoOptionsReview*
close -> Inactive
answer -> ThankU
ThankU
close -> Inactive
function render(model){
const currentState = model.active_states[0].name;
const isInactive = currentState === 'Inactive';
return (
<div>
<h1>{currentState}</h1>
<button onClick={() => model.emit('reviewRegions')} disabled={!isInactive}>Regions</button>
<button onClick={() => model.emit('reviewTwoOptions')} disabled={!isInactive}>Two Options</button>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment