Skip to content

Commit 2ca3e50

Browse files
committed
fix(macro): Allow proxies to become active via .activate()
1 parent 24d832e commit 2ca3e50

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sources/macro.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,17 @@ export function proxy(publicAPI, model) {
10081008
}
10091009
};
10101010

1011+
publicAPI.activate = () => {
1012+
if (model.proxyManager) {
1013+
const setActiveMethod = `setActive${capitalize(
1014+
publicAPI.getProxyGroup().slice(0, -1)
1015+
)}`;
1016+
if (model.proxyManager[setActiveMethod]) {
1017+
model.proxyManager[setActiveMethod](publicAPI);
1018+
}
1019+
}
1020+
};
1021+
10111022
// property link
10121023
model.propertyLinkSubscribers = [];
10131024
publicAPI.registerPropertyLinkForGC = (otherLink) => {

0 commit comments

Comments
 (0)