j-templates 9.0.0 → 9.0.1

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.
package/Node/vNode.js CHANGED
@@ -312,6 +312,8 @@ function ScheduledAssignment(assign) {
312
312
  return;
313
313
  scheduled = true;
314
314
  NodeConfig.scheduleUpdate(function () {
315
+ if (ObservableScope.IsDestroyed(scope))
316
+ return;
315
317
  scheduled = false;
316
318
  const value = ObservableScope.Peek(scope);
317
319
  assign(value);
@@ -207,6 +207,7 @@ export declare namespace ObservableScope {
207
207
  function OnDestroyed<T>(scope: IObservableScope<T>, callback: {
208
208
  (lastValue: T): void;
209
209
  }): void;
210
+ function IsDestroyed(scope: IObservableScope<unknown>): boolean;
210
211
  /**
211
212
  * Marks a scope as dirty, triggering recomputation on next access or batch.
212
213
  * No-op for static scopes (created when a `Create` valueFunction reads no reactive
@@ -663,6 +663,10 @@ export var ObservableScope;
663
663
  Emitter.On(scope.onDestroyed, callback);
664
664
  }
665
665
  ObservableScope.OnDestroyed = OnDestroyed;
666
+ function IsDestroyed(scope) {
667
+ return scope.destroyed;
668
+ }
669
+ ObservableScope.IsDestroyed = IsDestroyed;
666
670
  /**
667
671
  * Marks a scope as dirty, triggering recomputation on next access or batch.
668
672
  * No-op for static scopes (created when a `Create` valueFunction reads no reactive
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "j-templates",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
4
4
  "description": "j-templates",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/TypesInCode/jTemplates",