Preview environment

typealias CacheTypeReducer

export type CacheTypeReducer<State extends CacheType, CachedType, RawType = CachedType, PresentType = CachedType | RawType, Fallback = PresentType | null,> = [State] extends ['cached'] ? CachedType : [State] extends ['raw']  ? RawType  : [State] extends ['raw' | 'cached']   ? PresentType   : Fallback;

Type Parameters

State extends CacheType

CachedType

optional
RawType? = CachedType

optional
PresentType? = CachedType | RawType

optional
Fallback? = PresentType | null

Union Members

[State] extends ['cached'] ? CachedType : [State] extends ['raw'] ? RawType : [State] extends ['raw' | 'cached'] ? PresentType : Fallback