Skip to content

Instantly share code, notes, and snippets.

@gevgeny
Created October 31, 2019 13:35
Show Gist options
  • Save gevgeny/ef0cf89da1792b5abcb486b03e51220d to your computer and use it in GitHub Desktop.
Save gevgeny/ef0cf89da1792b5abcb486b03e51220d to your computer and use it in GitHub Desktop.
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