@constela/runtime 0.10.0 → 0.10.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/dist/index.d.ts CHANGED
@@ -118,6 +118,7 @@ interface AppInstance {
118
118
  destroy(): void;
119
119
  setState(name: string, value: unknown): void;
120
120
  getState(name: string): unknown;
121
+ subscribe(name: string, fn: (value: unknown) => void): () => void;
121
122
  }
122
123
  /**
123
124
  * Creates a Constela application and mounts it to the DOM.
package/dist/index.js CHANGED
@@ -13157,6 +13157,11 @@ function createApp(program, mount) {
13157
13157
  },
13158
13158
  getState(name) {
13159
13159
  return state.get(name);
13160
+ },
13161
+ subscribe(name, fn) {
13162
+ if (destroyed) return () => {
13163
+ };
13164
+ return state.subscribe(name, fn);
13160
13165
  }
13161
13166
  };
13162
13167
  }
@@ -13231,6 +13236,11 @@ function hydrateApp(options) {
13231
13236
  },
13232
13237
  getState(name) {
13233
13238
  return state.get(name);
13239
+ },
13240
+ subscribe(name, fn) {
13241
+ if (destroyed) return () => {
13242
+ };
13243
+ return state.subscribe(name, fn);
13234
13244
  }
13235
13245
  };
13236
13246
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constela/runtime",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Runtime DOM renderer for Constela UI framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",