structured-fw 0.9.1 → 0.9.2

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.
@@ -16,8 +16,6 @@ export declare class ClientComponent extends EventEmitter {
16
16
  private initializerExecuted;
17
17
  destroyed: boolean;
18
18
  private redrawRequest;
19
- onDestroy?: Function;
20
- onRedraw?: Function;
21
19
  private bound;
22
20
  private conditionals;
23
21
  private conditionalCallbacks;
@@ -155,6 +155,7 @@ export class ClientComponent extends EventEmitter {
155
155
  if (this.destroyed) {
156
156
  return;
157
157
  }
158
+ this.emit('beforeRedraw');
158
159
  if (data) {
159
160
  objectEach(data, (key, val) => {
160
161
  this.setData(key, val, false);
@@ -178,9 +179,6 @@ export class ClientComponent extends EventEmitter {
178
179
  return;
179
180
  }
180
181
  this.loaded = false;
181
- if (typeof this.onRedraw === 'function') {
182
- this.onRedraw.apply(this);
183
- }
184
182
  this.unbindAll();
185
183
  const childStoreChangeCallbacks = {};
186
184
  Array.from(this.children).forEach((child) => {
@@ -221,6 +219,7 @@ export class ClientComponent extends EventEmitter {
221
219
  }
222
220
  this.updateConditionals(false);
223
221
  this.loaded = true;
222
+ this.emit('afterRedraw');
224
223
  }
225
224
  initConditionals(node) {
226
225
  const isSelf = node === undefined;
@@ -701,9 +700,7 @@ export class ClientComponent extends EventEmitter {
701
700
  this.redrawRequest.abort();
702
701
  this.redrawRequest = null;
703
702
  }
704
- if (typeof this.onDestroy === 'function') {
705
- await this.onDestroy.apply(this);
706
- }
703
+ this.emit('beforeDestroy');
707
704
  this.store.destroy();
708
705
  this.unbindAll();
709
706
  this.conditionals = [];
@@ -714,6 +711,7 @@ export class ClientComponent extends EventEmitter {
714
711
  this.initializer = null;
715
712
  this.data = {};
716
713
  this.destroyed = true;
714
+ this.emit('afterDestroy');
717
715
  }
718
716
  bind(element, event, callback) {
719
717
  if (element instanceof HTMLElement) {
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "license": "MIT",
15
15
  "type": "module",
16
16
  "main": "build/index",
17
- "version": "0.9.1",
17
+ "version": "0.9.2",
18
18
  "scripts": {
19
19
  "develop": "tsc --watch",
20
20
  "startDev": "cd build && nodemon --watch '../app/**/*' --watch '../build/**/*' -e js,html,css index.js",