Skip to content

Instantly share code, notes, and snippets.

@robertsheacole
Created August 7, 2018 20:50
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 robertsheacole/be77afe04c03499e02f84adbc37b4984 to your computer and use it in GitHub Desktop.
Save robertsheacole/be77afe04c03499e02f84adbc37b4984 to your computer and use it in GitHub Desktop.
A very simple function that syncs up two objects without a bulky framework.
function reactive(origin, destination) {
return new Proxy(origin, {
set(target, key, value) {
Reflect.set(target, key, value);
destination[key] = value
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment