Skip to content

Commit f56e76b

Browse files
committed
general cleanup
1 parent 95ad078 commit f56e76b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/plexus-core/src/watchable.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ type HistorySeed<ValueType = any> = {
3232
archive_tail: Array<ValueType>
3333
}
3434

35-
export class Watchable<
36-
ValueType = any
37-
// ValueType extends AlmostAnything = Input extends Fetcher<infer V> ? V : Input
38-
> {
35+
export class Watchable<ValueType = any> {
3936
protected _watchableStore: WatchableStore<
4037
PlexusWatchableValueInterpreter<ValueType>
4138
>
@@ -102,10 +99,7 @@ export class Watchable<
10299
}
103100
}
104101

105-
export class WatchableMutable<
106-
// Input = never,
107-
ValueType = any
108-
> extends Watchable<ValueType> {
102+
export class WatchableMutable<ValueType = any> extends Watchable<ValueType> {
109103
private _history: HistorySeed | undefined
110104
// constructor(instance: () => PlexusInstance, init: () => ValueType)
111105
// constructor(instance: () => PlexusInstance, init: ValueType)

packages/plexus-utils/src/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export type UnionToIntersection<U> = (
3131
) extends (k: infer I) => void
3232
? I
3333
: never
34+
3435
export type IsUnion<T> = [T] extends [UnionToIntersection<T>] ? false : true
3536

3637
export type PlexusWatchableValueInterpreter<Value> = Value extends (
@@ -62,14 +63,17 @@ export declare type AsyncState<T> =
6263
}
6364

6465
export declare type FunctionReturningPromise = (...args: any[]) => Promise<any>
66+
6567
export declare type PromiseType<P extends Promise<any>> = P extends Promise<
6668
infer T
6769
>
6870
? T
6971
: never
72+
7073
declare type StateFromFunctionReturningPromise<
7174
T extends FunctionReturningPromise
7275
> = AsyncState<PromiseType<ReturnType<T>>>
76+
7377
export declare type AsyncFnReturn<
7478
T extends FunctionReturningPromise = FunctionReturningPromise
7579
> = [StateFromFunctionReturningPromise<T>, T]

0 commit comments

Comments
 (0)