Skip to content
Myr

refactor(types): prefer type alias (#625)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daishi Kato · committed by GitHub · parent 8665dd6 · Browse files · 3 files+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+4 added−4 removed

  • other:+4 added−4 removed

3 files+4 added−4 removed

modified:src/context.ts+1 added-1 removed
modified:src/middleware.ts+1 added-1 removed
369 unmodified lines
370 onHydrate: (fn: (state: S) => void) => void371 }372}373374interface Thenable<Value> {374type Thenable<Value> = {375 then<V>(376 onFulfilled: (value: Value) => V | Promise<V> | Thenable<V>377 ): Thenable<V>378 catch<V>(
225 unmodified lines
modified:src/vanilla.ts+2 added-2 removed
12 unmodified lines
13export type StateSelector<T extends State, U> = (state: T) => U14export type EqualityChecker<T> = (state: T, newState: T) => boolean15export type StateListener<T> = (state: T, previousState: T) => void16export type StateSliceListener<T> = (slice: T, previousSlice: T) => void17export interface Subscribe<T extends State> {17export type Subscribe<T extends State> = {18 (listener: StateListener<T>): () => void19 /**20 * @deprecated Please use `subscribeWithSelector` middleware21 */
16 unmodified lines
38 ): void39}40export type GetState<T extends State> = () => T41export type Destroy = () => void42export interface StoreApi<T extends State> {42export type StoreApi<T extends State> = {43 setState: SetState<T>44 getState: GetState<T>45 subscribe: Subscribe<T>46 destroy: Destroy
87 unmodified lines