@guanghechen/observable 6.1.2 → 6.1.3
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/CHANGELOG.md +10 -0
- package/lib/types/index.d.ts +12 -10
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## <small>6.1.3 (2024-09-19)</small>
|
|
7
|
+
|
|
8
|
+
- :art: improve(viewmodel): support to create Computed from another Computed
|
|
9
|
+
([5fc89ba](https://github.com/guanghechen/sora/commit/5fc89ba))
|
|
10
|
+
|
|
11
|
+
# Change Log
|
|
12
|
+
|
|
13
|
+
All notable changes to this project will be documented in this file. See
|
|
14
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
15
|
+
|
|
6
16
|
## <small>6.1.2 (2024-09-18)</small>
|
|
7
17
|
|
|
8
18
|
- :rotating_light: improve: fix lint ([3083212](https://github.com/guanghechen/sora/commit/3083212))
|
package/lib/types/index.d.ts
CHANGED
|
@@ -24,22 +24,24 @@ interface IObservableNextOptions {
|
|
|
24
24
|
*/
|
|
25
25
|
readonly force?: boolean;
|
|
26
26
|
}
|
|
27
|
-
interface
|
|
27
|
+
interface IBaseObservable<T> extends IBatchDisposable, ISubscribable<T> {
|
|
28
|
+
getSnapshot: () => T;
|
|
29
|
+
}
|
|
30
|
+
interface IObservable<T> extends IBaseObservable<T> {
|
|
28
31
|
readonly equals: IEquals<T>;
|
|
29
|
-
getSnapshot(): T;
|
|
30
32
|
next(value: T, options?: IObservableNextOptions): void;
|
|
31
33
|
}
|
|
32
|
-
type IValueList<T extends Array<
|
|
33
|
-
[K in keyof T]: T[K] extends
|
|
34
|
+
type IValueList<T extends Array<IBaseObservable<any>>> = {
|
|
35
|
+
[K in keyof T]: T[K] extends IBaseObservable<infer U> ? U : never;
|
|
34
36
|
};
|
|
35
37
|
type IValueMap<T extends object> = {
|
|
36
|
-
[key in keyof T]: T[key] extends
|
|
38
|
+
[key in keyof T]: T[key] extends IBaseObservable<infer U> ? U : never;
|
|
37
39
|
};
|
|
38
40
|
type IObservableRecord<T extends object> = {
|
|
39
|
-
[key in keyof T]: T[key] extends
|
|
41
|
+
[key in keyof T]: T[key] extends IBaseObservable<any> ? T[key] : never;
|
|
40
42
|
};
|
|
41
43
|
type IObservableKey<T extends object> = keyof {
|
|
42
|
-
[key in keyof T]: T[key] extends
|
|
44
|
+
[key in keyof T]: T[key] extends IBaseObservable<any> ? key : never;
|
|
43
45
|
};
|
|
44
46
|
|
|
45
47
|
declare class Observable<T> extends BatchDisposable implements IObservable<T> {
|
|
@@ -97,13 +99,13 @@ interface ITicker extends IObservable<number> {
|
|
|
97
99
|
* @param observable
|
|
98
100
|
* @param options
|
|
99
101
|
*/
|
|
100
|
-
observe(observable:
|
|
102
|
+
observe(observable: IBaseObservable<any>, options?: ITickerObserveOptions): void;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
declare class Ticker extends Observable<number> implements ITicker {
|
|
104
106
|
constructor(options?: ITickerOptions);
|
|
105
107
|
tick(options?: IObservableNextOptions): void;
|
|
106
|
-
observe<T>(observable:
|
|
108
|
+
observe<T>(observable: IBaseObservable<T>, options?: ITickerObserveOptions): IUnobservable;
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
declare const noop: (..._args: any[]) => void;
|
|
@@ -111,4 +113,4 @@ declare const noopUnsubscribable: IUnsubscribable;
|
|
|
111
113
|
declare const noopUnobservable: IUnobservable;
|
|
112
114
|
declare const isObservable: (obj: unknown) => obj is IObservable<unknown>;
|
|
113
115
|
|
|
114
|
-
export { type IEquals, type IObservable, type IObservableKey, type IObservableNextOptions, type IObservableOptions, type IObservableRecord, type ITicker, type ITickerObserveOptions, type ITickerOptions, type IUnobservable, type IValueList, type IValueMap, Observable, Ticker, isObservable, noop, noopUnobservable, noopUnsubscribable };
|
|
116
|
+
export { type IBaseObservable, type IEquals, type IObservable, type IObservableKey, type IObservableNextOptions, type IObservableOptions, type IObservableRecord, type ITicker, type ITickerObserveOptions, type ITickerOptions, type IUnobservable, type IValueList, type IValueMap, Observable, Ticker, isObservable, noop, noopUnobservable, noopUnsubscribable };
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guanghechen/observable",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.3",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "guanghechen",
|
|
6
6
|
"url": "https://github.com/guanghechen/"
|
|
7
7
|
},
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/guanghechen/sora/tree/@guanghechen/observable@6.1.
|
|
10
|
+
"url": "https://github.com/guanghechen/sora/tree/@guanghechen/observable@6.1.2",
|
|
11
11
|
"directory": "packages/observable"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/guanghechen/sora/tree/@guanghechen/observable@6.1.
|
|
13
|
+
"homepage": "https://github.com/guanghechen/sora/tree/@guanghechen/observable@6.1.2/packages/observable#readme",
|
|
14
14
|
"keywords": [
|
|
15
15
|
"observable"
|
|
16
16
|
],
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"@guanghechen/disposable": "^1.0.0-alpha.5",
|
|
38
38
|
"@guanghechen/subscriber": "^1.0.0-alpha.2"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "45591108069520e49318211b9449391e84e80ef1"
|
|
41
41
|
}
|