Skip to content

Instantly share code, notes, and snippets.

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