Skip to content

Commit

Permalink
add WixMap
Browse files Browse the repository at this point in the history
  • Loading branch information
gileck committed Sep 30, 2024
1 parent 0aa1aaf commit af6e1a5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/templates/optimizing.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap()
}

if (window.WixMap) {
return new window.WixMap()
}

return new WeakMap()
}

function base() {
function $NAME($model, $funcLibRaw, $batchingStrategy) {
let $funcLib = $funcLibRaw
Expand Down Expand Up @@ -167,7 +179,7 @@ function base() {
function library() {
const $trackingMap = new WeakMap();
const $trackingWildcards = new WeakMap();
const $invalidatedMap = new WeakMap();
const $invalidatedMap = getWeakMap()
const $invalidatedRoots = new Set();
$invalidatedRoots.$subKeys = new Map();
$invalidatedRoots.$parentKey = null;
Expand Down

0 comments on commit af6e1a5

Please sign in to comment.