Comparing version 0.6.0-alpha.12 to 0.6.0
@@ -121,3 +121,2 @@ "use strict"; | ||
const key_func = 'func'; | ||
const key_signal = 'signal'; | ||
const obj_def_prop_value = (obj, key, value) => (obj_def_prop(obj, key, { value }), value); | ||
@@ -324,3 +323,2 @@ const obj_def_prop_trait = (obj, key, trait) => obj_def_prop(obj, key, { | ||
const trait_ent_as_value = (ctx) => (value_from(ctx[key_get], ctx[key_set])); | ||
const trait_ent_as_signal = (ctx) => (signal_from(ctx[key_get], ctx[key_set])); | ||
const trait_ent_op = (ctx, f) => ((f = f(ctx)), (f === const_undef ? ctx : f)); | ||
@@ -345,6 +343,4 @@ // readable.to:ns | ||
// .as.value | ||
// .as.signal | ||
const proto_entity_readable_as_ns = obj_create(pure_fn); | ||
obj_def_prop_trait_ns(proto_entity_readable_as_ns, key_value, trait_ent_as_value); | ||
obj_def_prop_trait_ns(proto_entity_readable_as_ns, key_signal, trait_ent_as_signal); | ||
// readable | ||
@@ -364,3 +360,2 @@ // .sync | ||
// .as.value | ||
// .as.signal | ||
// .promise | ||
@@ -446,9 +441,2 @@ const proto_entity_readable = obj_create(pure_fn); | ||
}; | ||
const make_flag = (initial, is_signal) => { | ||
initial = !!initial; | ||
const h = box(initial, 0, is_signal && pure_arrow_fn_returns_undef); | ||
h[key_is_signal] = is_signal; | ||
h[key_has_default] = 1; | ||
return fill_entity(h, proto_entity_writtable_leaf, 1, initial, 0, (v) => h[1](!!v)); | ||
}; | ||
const get_getter_to_reactionable_or_custom = (re) => ((re && re[key_get]) || (typeof re === const_string_function ? re : () => re)); | ||
@@ -472,7 +460,5 @@ const make_value_combine_handler = (cfg, fn) => { | ||
const value_combine = (cfg, fn) => fill_entity(make_value_combine_handler(cfg, fn), proto_entity_readable); | ||
const value_flag = (initial) => make_flag(initial); | ||
value[key_trigger] = value_trigger; | ||
value[key_from] = value_from; | ||
value[key_combine] = value_combine; | ||
value[key_flag] = value_flag; | ||
const signal = (function (initial) { | ||
@@ -497,3 +483,2 @@ const h = box(initial, 0, pure_arrow_fn_returns_undef); | ||
}; | ||
const signal_flag = (initial) => make_flag(initial, 1); | ||
signal_trigger_flag[key_invert] = signal_trigger_flag_invert; | ||
@@ -503,3 +488,2 @@ signal_trigger[key_flag] = signal_trigger_flag; | ||
signal[key_from] = signal_from; | ||
signal[key_flag] = signal_flag; | ||
// | ||
@@ -506,0 +490,0 @@ // Realar internal |
@@ -226,4 +226,2 @@ import { FC } from 'react'; | ||
untrack<R>(func: (value: WillExpand<O>) => R): Value<I, R>; | ||
to(): Value<I, undefined>; | ||
to<R>(value: R): Value<I, R>; | ||
}; | ||
@@ -237,5 +235,2 @@ pre: E_PreFilterUnTrackedPartial<I, Value<I, O>> & { | ||
}; | ||
as: { | ||
signal(): Signal<I, O>; | ||
}; | ||
} | ||
@@ -246,8 +241,3 @@ interface E_ValueReadonly<O> extends E_Readable<O, ValueReadonly<O>> { | ||
untrack<R>(func: (value: WillExpand<O>) => R): ValueReadonly<R>; | ||
to(): ValueReadonly<undefined>; | ||
to<R>(value: R): ValueReadonly<R>; | ||
}; | ||
as: { | ||
signal(): SignalReadonly<O>; | ||
}; | ||
} | ||
@@ -295,6 +285,2 @@ interface E_Signal<I, O> extends E_Writtable<I, O, Signal<I, O>>, E_FilterUnTrackedPartial<O, WillExtract<O>, Signal<I, WillExtract<O>>, Signal<I, WillEnsure<O>>> { | ||
}; | ||
flag: { | ||
(): Value<any, boolean>; | ||
(initial: any): Value<any, boolean>; | ||
}; | ||
from: { | ||
@@ -390,6 +376,2 @@ <O>(get: Re<O>): ValueReadonly<WillExpand<O>>; | ||
}; | ||
flag: { | ||
(): Signal<any, boolean>; | ||
(initial: any): Signal<any, boolean>; | ||
}; | ||
from: { | ||
@@ -396,0 +378,0 @@ <O>(get: Re<O>): SignalReadonly<O>; |
{ | ||
"name": "realar", | ||
"version": "0.6.0-alpha.12", | ||
"version": "0.6.0", | ||
"description": "Advanced state manager for React", | ||
@@ -91,3 +91,3 @@ "repository": { | ||
}, | ||
"gitHead": "1d0a8036e1e85e350b078c69898aef98df8fb740" | ||
"gitHead": "6a98fa261c63215e3beaffbfda91db17d052c8cf" | ||
} |
@@ -197,3 +197,2 @@ import React, { Context, FC } from 'react'; | ||
const key_func = 'func'; | ||
const key_signal = 'signal'; | ||
@@ -514,5 +513,2 @@ | ||
); | ||
const trait_ent_as_signal = (ctx) => ( | ||
signal_from(ctx[key_get], ctx[key_set]) | ||
); | ||
const trait_ent_op = (ctx, f) => ( | ||
@@ -559,6 +555,4 @@ (f = f(ctx)), (f === const_undef ? ctx : f) | ||
// .as.value | ||
// .as.signal | ||
const proto_entity_readable_as_ns = obj_create(pure_fn); | ||
obj_def_prop_trait_ns(proto_entity_readable_as_ns, key_value, trait_ent_as_value); | ||
obj_def_prop_trait_ns(proto_entity_readable_as_ns, key_signal, trait_ent_as_signal); | ||
@@ -579,3 +573,2 @@ // readable | ||
// .as.value | ||
// .as.signal | ||
// .promise | ||
@@ -762,10 +755,2 @@ const proto_entity_readable = obj_create(pure_fn); | ||
const make_flag = (initial, is_signal?) => { | ||
initial = !!initial; | ||
const h = (box as any)(initial, 0, is_signal && pure_arrow_fn_returns_undef); | ||
h[key_is_signal] = is_signal; | ||
h[key_has_default] = 1; | ||
return fill_entity(h, proto_entity_writtable_leaf, 1, initial, 0, (v) => h[1](!!v)); | ||
} | ||
const get_getter_to_reactionable_or_custom = (re) => ( | ||
@@ -798,3 +783,2 @@ (re && re[key_get]) || (typeof re === const_string_function ? re : () => re) | ||
const value_combine = (cfg, fn?) => fill_entity(make_value_combine_handler(cfg, fn), proto_entity_readable); | ||
const value_flag = (initial) => make_flag(initial) | ||
@@ -804,3 +788,2 @@ value[key_trigger] = value_trigger as any; | ||
value[key_combine] = value_combine; | ||
value[key_flag] = value_flag as any; | ||
@@ -826,3 +809,2 @@ | ||
} | ||
const signal_flag = (initial) => make_flag(initial, 1) | ||
@@ -833,3 +815,2 @@ signal_trigger_flag[key_invert] = signal_trigger_flag_invert; | ||
signal[key_from] = signal_from; | ||
signal[key_flag] = signal_flag as any; | ||
@@ -836,0 +817,0 @@ |
@@ -294,5 +294,2 @@ import { FC } from 'react'; | ||
untrack<R>(func: (value: WillExpand<O>) => R): Value<I, R> | ||
to(): Value<I, undefined> | ||
to<R>(value: R): Value<I, R> | ||
} | ||
@@ -306,5 +303,2 @@ pre: E_PreFilterUnTrackedPartial<I, Value<I, O>> & { | ||
} | ||
as: { | ||
signal(): Signal<I, O> | ||
} | ||
} | ||
@@ -319,9 +313,3 @@ | ||
untrack<R>(func: (value: WillExpand<O>) => R): ValueReadonly<R> | ||
to(): ValueReadonly<undefined> | ||
to<R>(value: R): ValueReadonly<R> | ||
} | ||
as: { | ||
signal(): SignalReadonly<O> | ||
} | ||
} | ||
@@ -395,6 +383,2 @@ | ||
}; | ||
flag: { | ||
(): Value<any, boolean>; | ||
(initial: any): Value<any, boolean>; | ||
} | ||
@@ -498,7 +482,2 @@ from: { | ||
flag: { | ||
(): Signal<any, boolean>; | ||
(initial: any): Signal<any, boolean>; | ||
} | ||
from: { | ||
@@ -505,0 +484,0 @@ <O>(get: Re<O>): SignalReadonly<O> |
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
216006
2906