Last active
October 24, 2017 17:55
-
-
Save Ginden/03004e52b3d331e236b5256e3b4c08ff to your computer and use it in GitHub Desktop.
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
| const REALM = Symbol(); | |
| Object.define(HTMLElement.prototype, 'realm', { | |
| get() { | |
| if (!Reflect.has(this, REALM)) this[REALM] = window; // Your construction logic goes here | |
| return this[REALM]; | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment