Comparing version 0.5.35 to 0.5.36
@@ -127,2 +127,3 @@ import { FC } from 'react'; | ||
var ready: typeof import(".").ready; | ||
var from: typeof signal_from; | ||
} | ||
@@ -133,2 +134,3 @@ declare function signal<T = void>(init: T): Signal<T>; | ||
var ready: typeof import(".").ready; | ||
var from: typeof signal_from; | ||
} | ||
@@ -166,2 +168,3 @@ declare function ready<T = void>(): ReadySignal<T, Ensurable<T>>; | ||
declare function ready_resolved<T>(value: T): ReadySignal<void, T>; | ||
declare function signal_from<T>(source: Reactionable<T>): Signal<T>; | ||
declare function stop_signal(): StopSignal; | ||
@@ -168,0 +171,0 @@ declare function loop(body: () => Promise<any>): () => void; |
@@ -83,2 +83,3 @@ "use strict"; | ||
signal.ready = ready; | ||
signal.from = signal_from; | ||
function ready(init) { | ||
@@ -121,2 +122,8 @@ let resolved = 0; | ||
} | ||
function signal_from(source) { | ||
const fn = source[0] || source; | ||
const dest = signal(fn()); | ||
on(source, dest); | ||
return dest; | ||
} | ||
function stop_signal() { | ||
@@ -123,0 +130,0 @@ is_stop_signal = 1; |
{ | ||
"name": "realar", | ||
"version": "0.5.35", | ||
"version": "0.5.36", | ||
"description": "React state manager", | ||
@@ -88,3 +88,3 @@ "repository": { | ||
}, | ||
"gitHead": "3d1fd142509e3956cbb93dba698c3ccd0ff30a9b" | ||
"gitHead": "186a72df2e1c9ea3df7f589c0156d0b10e4c9682" | ||
} |
@@ -268,2 +268,3 @@ import React, { Context, FC } from 'react'; | ||
signal.ready = ready; | ||
signal.from = signal_from; | ||
@@ -307,3 +308,2 @@ function ready<T = void>(): ReadySignal<T, Ensurable<T>>; | ||
on(source, dest); | ||
return dest as any; | ||
@@ -320,2 +320,9 @@ } | ||
function signal_from<T>(source: Reactionable<T>): Signal<T> { | ||
const fn = (source as any)[0] || (source as any); | ||
const dest = signal(fn()); | ||
on(source, dest); | ||
return dest as any; | ||
} | ||
function stop_signal(): StopSignal { | ||
@@ -322,0 +329,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
77984
1449