Created
October 31, 2019 13:35
-
-
Save gevgeny/ef0cf89da1792b5abcb486b03e51220d to your computer and use it in GitHub Desktop.
This file contains 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
function observable(target, propertyKey) { | |
console.log(`decorate ${propertyKey}`); | |
return { | |
get() {}, | |
set() {}, | |
}; | |
} | |
class State { | |
} | |
const descriptor = observable(State.prototype, "foo"); | |
Object.defineProperty(State.prototype, "foo", descriptor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment