diff --git a/package.json b/package.json index e121a95..3c7772a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nixix", - "version": "2.0.7", + "version": "2.0.8", "description": "NixixJS is a lightweight JavaScript Library used for building reactive User Interfaces.", "main": "./dom/index.ts", "module": "./dom/index.ts", diff --git a/primitives/Store.ts b/primitives/Store.ts index 409c891..1b40200 100644 --- a/primitives/Store.ts +++ b/primitives/Store.ts @@ -20,7 +20,7 @@ function createStoreProxy(obj: object | any[]) { let jsx = nixixStore.jsx const val = target[p]; let returnedValue: any = null; - if (!isPrimitive(val)) returnedValue = val; + if (!isPrimitive(val) || (p === '$$__id')) returnedValue = val; else { let signalMap = this.signalMap; if (jsx) { diff --git a/primitives/index.ts b/primitives/index.ts index 54057a1..e19e8a4 100644 --- a/primitives/index.ts +++ b/primitives/index.ts @@ -85,10 +85,10 @@ function callStore( nixixStore["$$__lastReactionProvider"] = "store"; nixixStore.Store === undefined && (nixixStore.Store = {}); const { Store: SStore } = nixixStore as Required - let value: Array | object = isFunction(initialValue) + let value: Array | object = cloneObject(isFunction(initialValue) ? (initialValue as Function)() - : initialValue; - + : initialValue ); + SStore[`_${storeId}_`] = { value: value }; let initValue = new Store({ value: value, id: storeId });