Skip to content

Instantly share code, notes, and snippets.

@Purecaesar
Created July 5, 2021 10:34
Show Gist options
  • Save Purecaesar/fffe1c0f6e30adcdd989bbc96cf96d97 to your computer and use it in GitHub Desktop.
Save Purecaesar/fffe1c0f6e30adcdd989bbc96cf96d97 to your computer and use it in GitHub Desktop.
...
return {
get() {
if (!inited) {
inited = true;
triger.next();
}
return originalDescriptor
? originalDescriptor.get.call(target)
: routerData;
},
set(value: any) {
routerData = value;
if (originalDescriptor) originalDescriptor.set.call(target, routerData);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment