Skip to content

Instantly share code, notes, and snippets.

@smockle
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smockle/236ec200c56e257e33b2 to your computer and use it in GitHub Desktop.
Save smockle/236ec200c56e257e33b2 to your computer and use it in GitHub Desktop.
class Container {
constructor(x) {
this.__value = x;
}
static of(x) {
return new Container(x);
}
map(f) {
return Container.of(f(this.__value));
}
};
export default Container;
var Container = function (x) {
this.__value = x;
};
Container.of = function(x) {
return new Container(x);
};
Container.prototype.map = function(f) {
return Container.of(f(this.__value));
};
export default Container;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment