@cascateer/core 2.3.2 → 2.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/store.ts +6 -6
- package/src/types.ts +2 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { App } from "./app";
|
|
|
3
3
|
export { createComponent } from "./component";
|
|
4
4
|
export { defineCustomProperties } from "./dom";
|
|
5
5
|
export { createElement, createFragment } from "./jsx-runtime";
|
|
6
|
-
export {
|
|
6
|
+
export { Serializable, type BrandedSerializer } from "./serializable";
|
|
7
7
|
export { createSlice } from "./slice";
|
|
8
8
|
export { type StoreEffect } from "./store";
|
|
9
9
|
export { type TerminalEffect } from "./terminal";
|
package/src/store.ts
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
MulticastSubject,
|
|
17
17
|
sequence,
|
|
18
18
|
} from "./operators";
|
|
19
|
-
import { Action, Transform } from "./types";
|
|
19
|
+
import { Action, MaybePromise, Transform } from "./types";
|
|
20
20
|
|
|
21
21
|
export type StoreEffect<Result> = () => Signal<Result>;
|
|
22
22
|
|
|
@@ -69,7 +69,7 @@ export class ExtendableStoreAdapter<
|
|
|
69
69
|
},
|
|
70
70
|
void
|
|
71
71
|
>;
|
|
72
|
-
register: UnaryFunction<(args: any) => Transform<any
|
|
72
|
+
register: UnaryFunction<(args: any) => Promise<Transform<any>>, void>;
|
|
73
73
|
}
|
|
74
74
|
>;
|
|
75
75
|
},
|
|
@@ -114,7 +114,7 @@ export class ExtendableStoreAdapter<
|
|
|
114
114
|
? T
|
|
115
115
|
: never,
|
|
116
116
|
>(
|
|
117
|
-
predicate: UnaryFunction<Args, Transform<T
|
|
117
|
+
predicate: UnaryFunction<Args, MaybePromise<Transform<T>>>,
|
|
118
118
|
config?: { sameOrigin?: boolean },
|
|
119
119
|
) => Action<Args, any>;
|
|
120
120
|
};
|
|
@@ -141,8 +141,8 @@ export class ExtendableStoreAdapter<
|
|
|
141
141
|
(signal) => ({
|
|
142
142
|
update: (predicate, config = {}) =>
|
|
143
143
|
thru(this.context.transform(key), (transform) => {
|
|
144
|
-
transform.register((args) =>
|
|
145
|
-
signal.reflector.predicate(predicate(args)),
|
|
144
|
+
transform.register(async (args) =>
|
|
145
|
+
signal.reflector.predicate(await predicate(args)),
|
|
146
146
|
);
|
|
147
147
|
|
|
148
148
|
return (args) =>
|
|
@@ -210,7 +210,7 @@ export class StoreProvider<Data> extends ExtendableStoreAdapter<
|
|
|
210
210
|
) {
|
|
211
211
|
return {
|
|
212
212
|
...event,
|
|
213
|
-
predicate: transform(event.data.args),
|
|
213
|
+
predicate: await transform(event.data.args),
|
|
214
214
|
callback: callbacks.get(event.id),
|
|
215
215
|
};
|
|
216
216
|
}
|
package/src/types.ts
CHANGED
|
@@ -68,6 +68,8 @@ export interface Action<Args, Result> extends UnaryFunction<
|
|
|
68
68
|
|
|
69
69
|
export type MaybeArray<T> = T | T[];
|
|
70
70
|
|
|
71
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
72
|
+
|
|
71
73
|
export type MaybeObservable<T> = T | Observable<T>;
|
|
72
74
|
|
|
73
75
|
export type MaybeObservableInput<T> = T | ObservableInput<T>;
|