Skip to content

Instantly share code, notes, and snippets.

@aaronshaf
Last active August 29, 2015 14:22
Show Gist options
  • Save aaronshaf/e75f3785e9c72122b5e2 to your computer and use it in GitHub Desktop.
Save aaronshaf/e75f3785e9c72122b5e2 to your computer and use it in GitHub Desktop.
Wouldn't partials here be better than virtual methods?
// ES7
getPlayers()
::map(x => x.character())
// ES6
let _val
_val = getPlayers()
_val = map(_val, x => x.character())
// ES7
getPlayers()
::map(x => x.character())
// ES6
let _val
_val = getPlayers()
_val = map.call(_val, x => x.character())
// See https://github.com/gsklee/bound-native-methods and http://babeljs.io/blog/2015/05/14/function-bind/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment