@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 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))
@@ -24,22 +24,24 @@ interface IObservableNextOptions {
24
24
  */
25
25
  readonly force?: boolean;
26
26
  }
27
- interface IObservable<T> extends IBatchDisposable, ISubscribable<T> {
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<IObservable<any>>> = {
33
- [K in keyof T]: T[K] extends IObservable<infer U> ? U : never;
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 IObservable<infer U> ? U : never;
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 IObservable<any> ? T[key] : never;
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 IObservable<any> ? key : never;
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: IObservable<any>, options?: ITickerObserveOptions): void;
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: IObservable<T>, options?: ITickerObserveOptions): IUnobservable;
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.2",
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.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.1/packages/observable#readme",
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": "61841206a2ca8060c0f47a32b9aa177b318f7c2e"
40
+ "gitHead": "45591108069520e49318211b9449391e84e80ef1"
41
41
  }