@contentstorage/core 0.3.40 → 0.3.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,6 @@
1
1
  import { populateTextWithVariables } from '../helpers/populateTextWithVariables.js';
2
2
  export let activeContent = null;
3
3
  export let appConfig = null;
4
- /**
5
- * The time in milliseconds an ID will remain in the memoryMap after its last call.
6
- * @type {number}
7
- */
8
- const EVICTION_TIME_MS = 10000;
9
4
  /**
10
5
  * NB! Only used when live editor mode is on
11
6
  */
@@ -79,18 +74,9 @@ export function getText(contentKey, variables) {
79
74
  if (window.parent && window.parent !== window) {
80
75
  const key = current;
81
76
  const existingEntry = window.memoryMap.get(key);
82
- if (existingEntry) {
83
- clearTimeout(existingEntry.timerId);
84
- }
85
77
  const idSet = existingEntry ? existingEntry.ids : new Set();
86
78
  idSet.add(contentKey); // Add the current ID to the set.
87
- const newTimerId = setTimeout(() => {
88
- console.log(`%cEvicting text: %c"${key}"`);
89
- window.memoryMap.delete(key);
90
- }, EVICTION_TIME_MS);
91
79
  window.memoryMap.set(key, {
92
- timerId: newTimerId,
93
- expiresAt: Date.now() + EVICTION_TIME_MS,
94
80
  ids: idSet,
95
81
  });
96
82
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@contentstorage/core",
3
3
  "author": "Kaido Hussar <kaidohus@gmail.com>",
4
4
  "homepage": "https://contentstorage.app",
5
- "version": "0.3.40",
5
+ "version": "0.3.41",
6
6
  "type": "module",
7
7
  "description": "Fetch content from contentstorage and generate TypeScript types",
8
8
  "module": "dist/index.js",