From 8427c99e623c64e712ccbd55d51382790216f321 Mon Sep 17 00:00:00 2001 From: Abhishiv Saxena Date: Fri, 5 Jul 2024 00:32:56 +0300 Subject: [PATCH] fix store implementation for array push --- package.json | 2 +- src/core/state/experimental.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f851984..8948ce6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "alfama", - "version": "1.1.1", + "version": "1.1.2", "author": "Abhishiv Saxena", "license": "MIT", "description": "Fine-grained reactive library with no compiler, no magic, and no virtual DOM", diff --git a/src/core/state/experimental.ts b/src/core/state/experimental.ts index ea20911..3a1df51 100644 --- a/src/core/state/experimental.ts +++ b/src/core/state/experimental.ts @@ -272,7 +272,6 @@ export const createStore = ( (p, value, previousValue, change) => { const changePath = p.split("."); const toRun = new Set(); - //console.log("chamge", change, changePath); // todo: improve this logic const manager = storeManager as StoreManager; for (const wire of manager.wires) { @@ -288,6 +287,8 @@ export const createStore = ( change && ["splice", "push", "pop"].indexOf(change.name) > -1 ) { + match = + encodeCursor(changePath.slice(0, cursor.length)) == cursorStr; // todo: adjust cursors to handle this case //switch (change.name) { // case 'insert':