From f835c9ac11d1e91a8abc6d56342b9e003cb8ef8b Mon Sep 17 00:00:00 2001 From: junbao Date: Sun, 3 Nov 2024 00:38:28 -0700 Subject: [PATCH] feat: merge mergeState --- package.json | 2 +- packages/amos-babel/package.json | 2 +- packages/amos-boxes/package.json | 2 +- packages/amos-boxes/src/objectBox.ts | 3 +-- packages/amos-core/package.json | 2 +- packages/amos-io/package.json | 2 +- packages/amos-persist/package.json | 2 +- packages/amos-react/package.json | 2 +- packages/amos-shapes/package.json | 2 +- packages/amos-testing/package.json | 2 +- packages/amos-typescript/package.json | 2 +- packages/amos-utils/package.json | 2 +- packages/amos/package.json | 2 +- packages/amos/src/index.ts | 12 ++++++++++++ 14 files changed, 25 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index d6c15d6..03d9cf3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@amos/root", "private": true, - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "license": "MIT", "workspaces": [ "packages/*", diff --git a/packages/amos-babel/package.json b/packages/amos-babel/package.json index be3ab1b..730e5fc 100644 --- a/packages/amos-babel/package.json +++ b/packages/amos-babel/package.json @@ -1,6 +1,6 @@ { "name": "amos-babel", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "private": true, "files": [], "peerDependencies": { diff --git a/packages/amos-boxes/package.json b/packages/amos-boxes/package.json index 589c42a..5c4c692 100644 --- a/packages/amos-boxes/package.json +++ b/packages/amos-boxes/package.json @@ -1,6 +1,6 @@ { "name": "amos-boxes", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "private": true, "files": [] } diff --git a/packages/amos-boxes/src/objectBox.ts b/packages/amos-boxes/src/objectBox.ts index 6538fa0..99abbc2 100644 --- a/packages/amos-boxes/src/objectBox.ts +++ b/packages/amos-boxes/src/objectBox.ts @@ -7,8 +7,7 @@ import { Box, Mutation, Selector } from 'amos-core'; import { resolveFuncValue, shallowEqual, type ValueOrFunc } from 'amos-utils'; export interface ObjectBox extends Box> { - mergeState(state: Partial): Mutation>; - mergeState(next: (state: Readonly) => Partial): Mutation>; + mergeState(state: ValueOrFunc>, [Readonly]>): Mutation>; set(key: K, value: T[K]): Mutation; get(key: K): Selector<[K], T[K]>; pick>(...keys: Ks): Selector>; diff --git a/packages/amos-core/package.json b/packages/amos-core/package.json index 20f541c..195c112 100644 --- a/packages/amos-core/package.json +++ b/packages/amos-core/package.json @@ -1,6 +1,6 @@ { "name": "amos-core", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "private": true, "files": [] } diff --git a/packages/amos-io/package.json b/packages/amos-io/package.json index 3d65d9d..8758268 100644 --- a/packages/amos-io/package.json +++ b/packages/amos-io/package.json @@ -1,6 +1,6 @@ { "name": "amos-io", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "private": true, "files": [] } diff --git a/packages/amos-persist/package.json b/packages/amos-persist/package.json index 9d5dac6..09f3d57 100644 --- a/packages/amos-persist/package.json +++ b/packages/amos-persist/package.json @@ -1,6 +1,6 @@ { "name": "amos-persist", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "private": true, "files": [] } diff --git a/packages/amos-react/package.json b/packages/amos-react/package.json index b9ba52a..621721c 100644 --- a/packages/amos-react/package.json +++ b/packages/amos-react/package.json @@ -1,6 +1,6 @@ { "name": "amos-react", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "private": true, "files": [], "peerDependencies": { diff --git a/packages/amos-shapes/package.json b/packages/amos-shapes/package.json index 2e02b02..13165ac 100644 --- a/packages/amos-shapes/package.json +++ b/packages/amos-shapes/package.json @@ -1,6 +1,6 @@ { "name": "amos-shapes", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "private": true, "files": [] } diff --git a/packages/amos-testing/package.json b/packages/amos-testing/package.json index 80ed6cd..5cec123 100644 --- a/packages/amos-testing/package.json +++ b/packages/amos-testing/package.json @@ -1,6 +1,6 @@ { "name": "amos-testing", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "private": true, "files": [] } diff --git a/packages/amos-typescript/package.json b/packages/amos-typescript/package.json index 71b8ffe..aa9c653 100644 --- a/packages/amos-typescript/package.json +++ b/packages/amos-typescript/package.json @@ -1,6 +1,6 @@ { "name": "amos-typescript", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "private": true, "files": [], "peerDependencies": { diff --git a/packages/amos-utils/package.json b/packages/amos-utils/package.json index ab18097..17d8576 100644 --- a/packages/amos-utils/package.json +++ b/packages/amos-utils/package.json @@ -1,6 +1,6 @@ { "name": "amos-utils", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "private": true, "files": [] } diff --git a/packages/amos/package.json b/packages/amos/package.json index 94a4dd7..ddc220d 100644 --- a/packages/amos/package.json +++ b/packages/amos/package.json @@ -1,6 +1,6 @@ { "name": "amos", - "version": "0.3.0-beta.31", + "version": "0.3.0-beta.32", "description": "An out-of-the-box state management library designed for your large-scale projects.", "keywords": [ "amos", diff --git a/packages/amos/src/index.ts b/packages/amos/src/index.ts index 2f4469c..113e4eb 100644 --- a/packages/amos/src/index.ts +++ b/packages/amos/src/index.ts @@ -123,8 +123,20 @@ export { } from 'amos-shapes'; export { AmosObject, + AnyFunc, Enhancer, + ID, + IsAny, + IsNever, + IsNoType, + IsUnknown, JSONState, + Unsubscribe, + ValueOrArray, + ValueOrConstructor, + ValueOrFunc, + ValueOrPromise, + ValueOrReadonlyArray, arrayEqual, isAmosObject, shallowEqual,