micro-observables
Advanced tools
Comparing version 1.3.2 to 1.3.3
import { Observable } from "./observable"; | ||
export declare function useObservable<T>(observable: Observable<T>): T; | ||
export declare function useComputedObservable<T>(compute: () => Observable<T>, deps: any[]): T; | ||
export declare function useComputedObservable<T>(compute: () => Observable<T>, deps?: any[]): T; |
@@ -13,4 +13,5 @@ "use strict"; | ||
function useComputedObservable(compute, deps) { | ||
if (deps === void 0) { deps = []; } | ||
return useObservable(react_1.useMemo(compute, deps)); | ||
} | ||
exports.useComputedObservable = useComputedObservable; |
@@ -12,11 +12,11 @@ export declare type Listener<T> = (val: T, prevVal: T) => void; | ||
onlyIf(predicate: (val: T) => boolean): Observable<T | undefined>; | ||
static compute<U>(inputObservables: [], transform: () => U): Observable<U>; | ||
static compute<T1, U>(inputObservables: [Observable<T1>], transform: (val1: T1) => U): Observable<U>; | ||
static compute<T1, T2, U>(inputObservables: [Observable<T1>, Observable<T2>], transform: (val1: T1, val2: T2) => U): Observable<U>; | ||
static compute<T1, T2, T3, U>(inputObservables: [Observable<T1>, Observable<T2>, Observable<T3>], transform: (val1: T1, val2: T2, val3: T3) => U): Observable<U>; | ||
static compute<T1, T2, T3, T4, U>(inputObservables: [Observable<T1>, Observable<T2>, Observable<T3>, Observable<T4>], transform: (val1: T1, val2: T2, val3: T3, val4: T4) => U): Observable<U>; | ||
static compute<T1, T2, T3, T4, T5, U>(inputObservables: [Observable<T1>, Observable<T2>, Observable<T3>, Observable<T4>, Observable<T5>], transform: (val1: T1, val2: T2, val3: T3, val4: T4, val5: T5) => U): Observable<U>; | ||
static compute<T1, T2, T3, T4, T5, T6, U>(inputObservables: [Observable<T1>, Observable<T2>, Observable<T3>, Observable<T4>, Observable<T5>, Observable<T6>], transform: (val1: T1, val2: T2, val3: T3, val4: T4, val5: T5, val6: T6) => U): Observable<U>; | ||
static compute<T1, T2, T3, T4, T5, T6, T7, U>(inputObservables: [Observable<T1>, Observable<T2>, Observable<T3>, Observable<T4>, Observable<T5>, Observable<T6>, Observable<T7>], transform: (val1: T1, val2: T2, val3: T3, val4: T4, val5: T5, val6: T6, val7: T7) => U): Observable<U>; | ||
static compute<T1, T2, T3, T4, T5, T6, T7, T8, U>(inputObservables: [Observable<T1>, Observable<T2>, Observable<T3>, Observable<T4>, Observable<T5>, Observable<T6>, Observable<T7>, Observable<T8>], transform: (val1: T1, val2: T2, val3: T3, val4: T4, val5: T5, val6: T6, val7: T7, val8: T8) => U): Observable<U>; | ||
static compute<U>(inputObservables: readonly [], transform: () => U): Observable<U>; | ||
static compute<T1, U>(inputObservables: readonly [Observable<T1>], transform: (val1: T1) => U): Observable<U>; | ||
static compute<T1, T2, U>(inputObservables: readonly [Observable<T1>, Observable<T2>], transform: (val1: T1, val2: T2) => U): Observable<U>; | ||
static compute<T1, T2, T3, U>(inputObservables: readonly [Observable<T1>, Observable<T2>, Observable<T3>], transform: (val1: T1, val2: T2, val3: T3) => U): Observable<U>; | ||
static compute<T1, T2, T3, T4, U>(inputObservables: readonly [Observable<T1>, Observable<T2>, Observable<T3>, Observable<T4>], transform: (val1: T1, val2: T2, val3: T3, val4: T4) => U): Observable<U>; | ||
static compute<T1, T2, T3, T4, T5, U>(inputObservables: readonly [Observable<T1>, Observable<T2>, Observable<T3>, Observable<T4>, Observable<T5>], transform: (val1: T1, val2: T2, val3: T3, val4: T4, val5: T5) => U): Observable<U>; | ||
static compute<T1, T2, T3, T4, T5, T6, U>(inputObservables: readonly [Observable<T1>, Observable<T2>, Observable<T3>, Observable<T4>, Observable<T5>, Observable<T6>], transform: (val1: T1, val2: T2, val3: T3, val4: T4, val5: T5, val6: T6) => U): Observable<U>; | ||
static compute<T1, T2, T3, T4, T5, T6, T7, U>(inputObservables: readonly [Observable<T1>, Observable<T2>, Observable<T3>, Observable<T4>, Observable<T5>, Observable<T6>, Observable<T7>], transform: (val1: T1, val2: T2, val3: T3, val4: T4, val5: T5, val6: T6, val7: T7) => U): Observable<U>; | ||
static compute<T1, T2, T3, T4, T5, T6, T7, T8, U>(inputObservables: readonly [Observable<T1>, Observable<T2>, Observable<T3>, Observable<T4>, Observable<T5>, Observable<T6>, Observable<T7>, Observable<T8>], transform: (val1: T1, val2: T2, val3: T3, val4: T4, val5: T5, val6: T6, val7: T7, val8: T8) => U): Observable<U>; | ||
} | ||
@@ -23,0 +23,0 @@ export declare class WritableObservable<T> extends Observable<T> { |
{ | ||
"name": "micro-observables", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20688
181