Created
December 18, 2016 20:37
-
-
Save aramkoukia/1bfde550f17056961f05ce88b5f15275 to your computer and use it in GitHub Desktop.
behavior-factories defining the behaviours
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
var speaker = function (state) { | |
var words = state.words; | |
return { | |
talk: function () { | |
console.log(state.name + ' says ' + words); | |
} | |
}; | |
}; | |
var walker = function (state) { | |
return { | |
walk: function () { | |
console.log(state.name + ' is walking'); | |
}, | |
run: function () { | |
console.log(state.name + ' is running'); | |
} | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment