Skip to content

Instantly share code, notes, and snippets.

@gsathya
Last active March 19, 2018 18:05
Show Gist options
  • Save gsathya/2fce4c1fb5e6d6bd608a410fea75b406 to your computer and use it in GitHub Desktop.
Save gsathya/2fce4c1fb5e6d6bd608a410fea75b406 to your computer and use it in GitHub Desktop.
// Based on https://web.archive.org/web/20160310120458/http://wiki.ecmascript.org/doku.php?id=strawman:scoped_object_extensions
// in whatever-extras.js
import Whatever from './whatever.js';
export extension Extensions = Whatever.protoype {
somethingComplex: function() { ... }
}
// in user code
import Whatever from './whatever.js';
import extension Extensions from './whatever-extras.js'
const whatever = new Whatever();
whatever.commonThing(123);
whatever.rareAndComplexThing(321);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment