mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-07-29 07:00:16 +02:00
⚡ Replaces defined with name/host
This commit is contained in:
18
dist/iife.js
vendored
18
dist/iife.js
vendored
@@ -316,7 +316,7 @@ var DDE = (() => {
|
||||
var scope = {
|
||||
/**
|
||||
* Gets the current scope
|
||||
* @returns {Object} Current scope context
|
||||
* @returns {typeof scopes[number]} Current scope context
|
||||
*/
|
||||
get current() {
|
||||
return scopes[scopes.length - 1];
|
||||
@@ -665,7 +665,7 @@ var DDE = (() => {
|
||||
}
|
||||
|
||||
// src/memo.js
|
||||
var memoMark = "__dde_memo";
|
||||
var memoMark = "__dde_memo_of";
|
||||
var memo_scope = [];
|
||||
function memo(key, generator) {
|
||||
if (!memo_scope.length) return generator(key);
|
||||
@@ -674,11 +674,11 @@ var DDE = (() => {
|
||||
return after(k, hasOwn(cache, k) ? cache[k] : generator(key));
|
||||
}
|
||||
memo.isScope = function(obj) {
|
||||
return obj[memoMark];
|
||||
return Boolean(obj[memoMark]);
|
||||
};
|
||||
memo.scope = function memoScope(fun, { signal, onlyLast } = {}) {
|
||||
memo.scope = function memoScopeCreate(fun, { signal, onlyLast } = {}) {
|
||||
let cache = oCreate();
|
||||
function memoScope2(...args) {
|
||||
function memoScope(...args) {
|
||||
if (signal && signal.aborted)
|
||||
return fun.apply(this, args);
|
||||
let cache_local = onlyLast ? cache : oCreate();
|
||||
@@ -693,10 +693,10 @@ var DDE = (() => {
|
||||
cache = cache_local;
|
||||
return out;
|
||||
}
|
||||
memoScope2[memoMark] = true;
|
||||
memoScope2.clear = () => cache = oCreate();
|
||||
if (signal) signal.addEventListener("abort", memoScope2.clear);
|
||||
return memoScope2;
|
||||
memoScope[memoMark] = fun;
|
||||
memoScope.clear = () => cache = oCreate();
|
||||
if (signal) signal.addEventListener("abort", memoScope.clear);
|
||||
return memoScope;
|
||||
};
|
||||
return __toCommonJS(index_exports);
|
||||
})();
|
||||
|
Reference in New Issue
Block a user