Skip to content

Instantly share code, notes, and snippets.

Peter Hanneman peterhanneman

View GitHub Profile
@getify
getify / 1.js
Created Sep 8, 2015
sync state machines with ES6 generators
View 1.js
// normal JS function
function stateMachine() {
var state = 1;
return {
next: function() {
switch (state) {
case 1:
// handle state 1
You can’t perform that action at this time.