From 3650358735b2fe8d24dd2f55f6688c7cd4197c61 Mon Sep 17 00:00:00 2001 From: Abhishiv Saxena Date: Mon, 8 Jul 2024 17:14:28 +0300 Subject: [PATCH] fix --- package.json | 2 +- src/core/state/experimental.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8948ce6..0fccf36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "alfama", - "version": "1.1.2", + "version": "1.1.3", "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 3a1df51..fbc7104 100644 --- a/src/core/state/experimental.ts +++ b/src/core/state/experimental.ts @@ -282,7 +282,10 @@ export const createStore = ( const cursor = cursorStr === "" ? [] : decodeCursor(cursorStr); if (change === undefined) { match = - encodeCursor(changePath.slice(0, cursor.length)) == cursorStr; + cursor.length <= changePath.length + ? encodeCursor(changePath.slice(0, cursor.length)) == + cursorStr + : true; } else if ( change && ["splice", "push", "pop"].indexOf(change.name) > -1