Comparing version 0.5.36 to 0.5.37
@@ -128,2 +128,3 @@ import { FC } from 'react'; | ||
var from: typeof signal_from; | ||
var combine: typeof signal_combine; | ||
} | ||
@@ -135,2 +136,3 @@ declare function signal<T = void>(init: T): Signal<T>; | ||
var from: typeof signal_from; | ||
var combine: typeof signal_combine; | ||
} | ||
@@ -169,2 +171,8 @@ declare function ready<T = void>(): ReadySignal<T, Ensurable<T>>; | ||
declare function signal_from<T>(source: Reactionable<T>): Signal<T>; | ||
declare function signal_combine(): Signal<[]>; | ||
declare function signal_combine<A>(a: Reactionable<A>): Signal<[A]>; | ||
declare function signal_combine<A, B>(a: Reactionable<A>, b: Reactionable<B>): Signal<[A, B]>; | ||
declare function signal_combine<A, B, C>(a: Reactionable<A>, b: Reactionable<B>, c: Reactionable<C>): Signal<[A, B, C]>; | ||
declare function signal_combine<A, B, C, D>(a: Reactionable<A>, b: Reactionable<B>, c: Reactionable<C>, d: Reactionable<D>): Signal<[A, B, C, D]>; | ||
declare function signal_combine<A, B, C, D, E>(a: Reactionable<A>, b: Reactionable<B>, c: Reactionable<C>, d: Reactionable<D>, e: Reactionable<E>): Signal<[A, B, C, D, E]>; | ||
declare function stop_signal(): StopSignal; | ||
@@ -171,0 +179,0 @@ declare function loop(body: () => Promise<any>): () => void; |
@@ -84,2 +84,3 @@ "use strict"; | ||
signal.from = signal_from; | ||
signal.combine = signal_combine; | ||
function ready(init) { | ||
@@ -128,2 +129,8 @@ let resolved = 0; | ||
} | ||
function signal_combine(...sources) { | ||
const get = () => sources.map((src) => (src[0] || src)()); | ||
const dest = signal(get()); | ||
on([get], dest); | ||
return dest; | ||
} | ||
function stop_signal() { | ||
@@ -130,0 +137,0 @@ is_stop_signal = 1; |
{ | ||
"name": "realar", | ||
"version": "0.5.36", | ||
"version": "0.5.37", | ||
"description": "React state manager", | ||
@@ -88,3 +88,3 @@ "repository": { | ||
}, | ||
"gitHead": "186a72df2e1c9ea3df7f589c0156d0b10e4c9682" | ||
"gitHead": "3d8a0c47abcb1c88e53bc18c9117c33427ea144d" | ||
} |
@@ -269,2 +269,3 @@ import React, { Context, FC } from 'react'; | ||
signal.from = signal_from; | ||
signal.combine = signal_combine; | ||
@@ -326,2 +327,30 @@ function ready<T = void>(): ReadySignal<T, Ensurable<T>>; | ||
function signal_combine(): Signal<[]>; | ||
function signal_combine<A>(a: Reactionable<A>): Signal<[A]>; | ||
function signal_combine<A, B>(a: Reactionable<A>, b: Reactionable<B>): Signal<[A, B]>; | ||
function signal_combine<A, B, C>( | ||
a: Reactionable<A>, | ||
b: Reactionable<B>, | ||
c: Reactionable<C> | ||
): Signal<[A, B, C]>; | ||
function signal_combine<A, B, C, D>( | ||
a: Reactionable<A>, | ||
b: Reactionable<B>, | ||
c: Reactionable<C>, | ||
d: Reactionable<D> | ||
): Signal<[A, B, C, D]>; | ||
function signal_combine<A, B, C, D, E>( | ||
a: Reactionable<A>, | ||
b: Reactionable<B>, | ||
c: Reactionable<C>, | ||
d: Reactionable<D>, | ||
e: Reactionable<E> | ||
): Signal<[A, B, C, D, E]>; | ||
function signal_combine(...sources: any): any { | ||
const get = () => sources.map((src: any) => (src[0] || src)()); | ||
const dest = signal(get()); | ||
on([get], dest); | ||
return dest as any; | ||
} | ||
function stop_signal(): StopSignal { | ||
@@ -328,0 +357,0 @@ is_stop_signal = 1; |
Sorry, the diff of this file is not supported yet
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
80116
1492