realar
Advanced tools
Comparing version 0.5.17 to 0.5.18
@@ -50,2 +50,3 @@ import { FC } from 'react'; | ||
declare function wrap<M, T>(target: Selector<T>, get: (data: T) => M): Selector<M>; | ||
declare function wrap<T>(target: () => T): Selector<T>; | ||
declare function loop(body: () => Promise<any>): () => void; | ||
@@ -52,0 +53,0 @@ declare type Pool<K> = K & { |
@@ -139,2 +139,5 @@ "use strict"; | ||
} | ||
else if (typeof target === 'function') { | ||
source_get = target; | ||
} | ||
if (!get && set && !source_set) { | ||
@@ -141,0 +144,0 @@ get = set; |
{ | ||
"name": "realar", | ||
"version": "0.5.17", | ||
"version": "0.5.18", | ||
"description": "React state manager", | ||
@@ -88,3 +88,3 @@ "repository": { | ||
}, | ||
"gitHead": "ccc4d8789050a41c4ebe31a8b3aaaf9c6433119d" | ||
"gitHead": "e484d617e971267876f5961f14906c4e8c33fc5c" | ||
} |
@@ -230,2 +230,4 @@ import React, { Context, FC } from 'react'; | ||
function wrap<T>(target: () => T): Selector<T>; | ||
function wrap(target: any, set?: any, get?: any) { | ||
@@ -236,2 +238,4 @@ let source_get: any, source_set: any; | ||
if (target[1]) source_set = target[1]; | ||
} else if (typeof target === 'function') { | ||
source_get = target; | ||
} | ||
@@ -238,0 +242,0 @@ if (!get && set && !source_set) { |
Sorry, the diff of this file is not supported yet
66397
1131