@arcgis/lumina 4.34.0-next.15 → 4.34.0-next.17

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.
@@ -212,10 +212,15 @@ const reCreateAccessor = (instance, component) => {
212
212
  console.error("Unable to resolve the useAccessor controller from the provided value");
213
213
  }
214
214
  };
215
- const createStore = (defaultValues) => {
215
+ const createStore = (initializer) => {
216
216
  const SubClass = class extends Accessor {
217
217
  };
218
- Object.entries(defaultValues).forEach(([name, value]) => property({ value })(SubClass.prototype, name));
218
+ const defaultValues = typeof initializer === "function" ? initializer() : initializer;
219
+ const descriptors = Object.getOwnPropertyDescriptors(defaultValues);
220
+ for (const [key, descriptor] of Object.entries(descriptors)) {
221
+ Object.defineProperty(SubClass.prototype, key, descriptor);
222
+ property()(SubClass.prototype, key);
223
+ }
219
224
  const State = subclass()(SubClass);
220
225
  return new State();
221
226
  };
@@ -2,7 +2,7 @@ import { default as Accessor } from '@arcgis/core/core/Accessor.js';
2
2
  /**
3
3
  * See https://qawebgis.esri.com/components/lumina/controllers/useAccessor#createstore-utility
4
4
  */
5
- export declare const createStore: <T extends Record<string, unknown>>(defaultValues: T | (() => T)) => __esri.Accessor & T;
5
+ export declare const createStore: <T extends Record<string, unknown>>(initializer: T | (() => T)) => __esri.Accessor & T;
6
6
  /** @deprecated Use {@link createStore} instead */
7
7
  export declare const createLegacyStore: <T extends Record<string, unknown>>(defaultState: T | (() => T)) => ObservableMap<T>;
8
8
  /** @deprecated Use {@link createStore} instead */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina",
3
- "version": "4.34.0-next.15",
3
+ "version": "4.34.0-next.17",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "license": "SEE LICENSE IN LICENSE.md",
24
24
  "dependencies": {
25
- "@arcgis/components-utils": "4.34.0-next.15",
25
+ "@arcgis/components-utils": "4.34.0-next.17",
26
26
  "@lit-labs/ssr": "^3.2.2",
27
27
  "@lit-labs/ssr-client": "^1.1.7",
28
28
  "@lit/context": "^1.1.5",