From 48bc287cade17b1a4e5185f29666fd17b2fa68ba Mon Sep 17 00:00:00 2001 From: liaohuanyu Date: Tue, 1 Nov 2022 19:47:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20san-store=E4=B8=AD=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E4=BA=86=E5=8A=A8=E6=80=81=E8=BF=94=E5=9B=9E=E7=9A=84keyMap?= =?UTF-8?q?=E5=90=8E=E6=8A=A5=E9=94=99=20#45?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/agents/store/store.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/agents/store/store.ts b/packages/backend/src/agents/store/store.ts index 9612143..dbb1246 100644 --- a/packages/backend/src/agents/store/store.ts +++ b/packages/backend/src/agents/store/store.ts @@ -195,10 +195,14 @@ export class StoreService implements IStoreService { key = cur.join('.'); value = cur; } - else { + else if (typeof cur === 'string') { value = parseName(cur); key = value.join('.'); } + else if (typeof cur === 'function') { + // TODO:处理 mapState 的 value 为函数 + return prev; + } prev[key] = value; return prev; }, this.paths); From 470647b94530b33426ae092cc16f529002c36b8b Mon Sep 17 00:00:00 2001 From: liaohuanyu Date: Fri, 8 Dec 2023 19:55:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dsan-store=202.2.0?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ packages/backend/src/agents/store/index.ts | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2397023..47e9bb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ChangeLog ======== +3.1.8 +------- + - [Bugfix] + - Fix bug introduced by san-store 2.2.0 3.1.7 ------- - [Add] diff --git a/packages/backend/src/agents/store/index.ts b/packages/backend/src/agents/store/index.ts index 70e31fe..14b2287 100644 --- a/packages/backend/src/agents/store/index.ts +++ b/packages/backend/src/agents/store/index.ts @@ -39,13 +39,15 @@ export class StoreAgent extends Agent { * 页面 import san-store: 创建默认的 store,new Store({name: '__default__'}) */ case 'store-default-inited': { - let {store} = data; - storeDecorator.handler(store); - if (store.name !== '__default__') { - console.warn('[SAN_DEVTOOLS]: there is must be something bad has happened in san-store'); - return; + let store = data.store || data.defaultStore; + if (store) { + storeDecorator.handler(store); + if (store.name !== '__default__') { + console.warn('[SAN_DEVTOOLS]: there is must be something bad has happened in san-store'); + return; + } + this.setStore(store); } - this.setStore(store); break; } /**