You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[]v.as.readonly()[]flow.resolve[]flowasrootlevelexportablefactoryfunction[].chan[]value.trigger.from[]value.trigger.flag.from[].map<-sysnonymfor.view(onthinking)[]x.group--x.op--x.blockx.block((ctx)=>({// if returns non undefineda: ctx.a,b: ctx.a.select()})).b.val[]v.as.signal(),v.as.trigger.flag()
Backlog:
[] Add callback to join, and combine. After It possible to use object config for join with callback
[] .as.trigger
[] .as.value.trigger
[] .as.signal.trigger
I think better way in that case is removing callback support for current version.
because without callback for combine and join no have any conficts for syntax.
I can use track|untrack for join without callback with no disharmony
--> decision for version 0.6:
[] remove callback support for join and combine
[] Add track|untrack for join
...disharmony was stay
--> decision number two) The second
[] rename join to "attach" or "merge"
Task: The saving consistency of track|untrack for append|attach|join|merge function
Have a reason for join without tracking for a set of rective values.
Have a reason join for signals?
value.combine() -> ok
value.join() -> ok
I cant implement signal.combine([], fn and s.join([], fn) because I have not flag for ready all
signals from argument
signal.combine() -> not ok
signal.join() -> not ok
maybe support combine and join only for values now.
For signal I can use merge
const s = signal(0);
s.merge([() => s.val, ...]).val == 0; without callback
Summary:
[] I should implement value.combine([]|{}, fn?), and value(0).combine([] | {}, fn?)
- track|untrack for combine? (I can not support untrack for combine values)
[] No have similar for signal in 0.6 versions.
value.from(() => ({
a: a.val,
b: b.val
}))
value.combine({ a, b }) -> better...
Always tracked, and it used only for values
value(0).combine - have a problem with track|untrack semantic not for 0.6 version.
I should make only value.combine. Aren't It?
Ok. For 0.6 its enough
cosntv=value(0);v.flow((value)=>{constticket=local(()=>wait(k));if(!ticket.val)returnflow.stop();returnvalue;});v.flow.filter(()=>{returnlocal(()=>wait(k)).val});local(expr)// <- bind only first time not necessary bind it every time// if you need bind every time you should use plain function not local expression.// synonim of local(expr, []);local(expr,[<realvaluedep>, ...])
local(expr, <refreshsymbolorexpression>);
// or all combination of that
local(expr, <refreshsymbolorexpression>, [<realvaluedep>, ...]);
local(expr, [<realvaluedep>, ...], <refreshsymbolorexpression>);
constv=value(0);consts=signal(0);// wait.all([v, s]) - it is a ready (trigger)awaitwait.all([v,s]).promiseawaitwait.once([v,s]).promisewait(v)// similar to signal.trigger.from(v) or v.to.signal.trigger()
constk=signal(0);constm=value(0);v.flow.wait(m).flow.wait.all(k,m)// or synonim to .flow.wait.all([k, m]) -- think about.flow.wait.race(k,m).to((v)=>console.log(v));
constk=signal(0);constm=value(0);v.flow.wait(m,(v_val,m_val)=>returnv_val+m_val).flow.wait.all([k,m],(v_val,[k_val,m_val])=>returnv_val+k_val+m_val)// or stop of course (maybe I can get resolve???).flow.wait.race([k,m],(v_val,[k_val,m_val],resolve,v_val_prev)=>{});.to((v)=>console.log(v));
You may rely on useMemo as a performance optimization, not as a semantic guarantee. In the future, React may choose to “forget” some previously memoized values and recalculate them on next render, e.g. to free memory for offscreen components. Write your code so that it still works without useMemo — and then add it to optimize performance.
consta=value(0);constb=chain(()=>a.val);assert(b.val===undefined);a(5);assert(b.val===undefined);b.input.to(b.output);// "to" better than "watch"a(6);assert(b.val===6);
privatefinish_purchase=pool(async()=>{if(this.finish_purchase.count>1)return;// not count.val here});
consta=pool(async()=>{if(a.count.val>1)returna.threads[0].promise;// Return promise from first thread}assert(a.flat.pending===false);assert(chan(async()=>{}).flat.pending===false);
input.handler<-(ev)=>ev.target.value// proposal for another names.// input.delegate// input.change// input.eventinput.validinput.valid.pendinginput.validator(signal<string>().map((state)=>/a/.test(state)))// input.validator.async() // or// Interested but no consistency to other code base.// input.validator((signal) => {// return signal.as.chan().map(async () => {})// });// Final perfect versioninput.validator([signal<string>().filter()<--whatwillhappensifvalidatorwillbestoppedchan<string>().map(async(state)=>awaitfetch_is_valid(state)),(state)=>/aa/.test(state),async(state)=>awaitext_test(state)]);
proposal: remove select.multiple
Improve "select" to "select.multiple" signature
consts=select({a: (state)=>state.a});
The argument can be function, reactive container, object map, or array tuple.
proposal: reactive container as argument of "map" (and array of)
constpipe_double=signal<number>().map(state=>state*2);value(1).map(pipe_double).val// 2value(1).map([pipe_double,pipe_double]).val// 4// Use signature as an array or as reactive container, or usual function signature.
Warning: Cannot update a component (`fn`) while rendering a different component (`Form`). To locate the bad setState() call inside `Form`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render
at Form (https://0sziu.csb.app/src/App.tsx:30:35)
at fn (https://0sziu.csb.app/node_modules/realar/build/index.js:697:30)
signal.from(()=>{return[buyAnnualLocale.val,sharedPurchases().annual_subscription.val]}).select(([locale,sub])=>{// both variables have one type "string | Subscription | undefined"if(!sub)returnvoid0;constlocalized_price=(subasany)?.localizedPrice;if(!localized_price)returnvoid0;returnlocale.text})
consty: Value<boolean> = value(false);
/*
Type 'Value<false,false>' is not assignable to type 'Value<boolean,boolean>'.
Type 'Value<false,false>' is not assignable to type '{(value: boolean): void;set(value: boolean): void;}'.
Types of parameters 'value' and 'value' are incompatible.
Type 'boolean' is not assignable to type 'false'.ts(2322)
*/
Activity
betula commentedon May 10, 2021
Working started:
[+] reset
[+] promise
betula commentedon May 22, 2021
Backlog from api-0.6 implementation
betula commentedon Jun 3, 2021
Backlog:
[] Add callback to join, and combine. After It possible to use object config for join with callback
[] .as.trigger
[] .as.value.trigger
[] .as.signal.trigger
[] signal.trigger.resolved
[] value.trigger.resolved
[] test case "should work signal.trigger with configured .pre"
[] signal.trigger.from
[] value.trigger.from
[] Add Loader example to documentation
betula commentedon Jun 6, 2021
Join brainstorm:
[] Add track|untrack for join with callback
Summary:
[] I should implement value.combine([]|{}, fn?), and value(0).combine([] | {}, fn?)
- track|untrack for combine? (I can not support untrack for combine values)
[] No have similar for signal in 0.6 versions.
value.from(() => ({
a: a.val,
b: b.val
}))
value.combine({ a, b }) -> better...
Always tracked, and it used only for values
value(0).combine - have a problem with track|untrack semantic not for 0.6 version.
I should make only value.combine. Aren't It?
Ok. For 0.6 its enough
betula commentedon Jun 6, 2021
Backlog
[] as.value(dafault_value?)
[] support reactionable for untrack
[] value().get.untrack()
betula commentedon Jun 6, 2021
Backlog
[] Add default for resolve "Will" type
betula commentedon Jun 7, 2021
Backlog:
And I think to very interesting idea is the convert "reset" function method to signal
[-]low: api extendable list (0.6-0.7 roadmap)[/-][+]low: the stream of conciseness 0.7+ roadmap[/+]betula commentedon Jun 7, 2021
proposal: local
betula commentedon Jun 7, 2021
proposal: wait
betula commentedon Jun 7, 2021
up: replace useMemo by useRef
betula commentedon Jun 7, 2021
proposal: chain
Think about "chain" abstraction
betula commentedon Jun 7, 2021
proposal: pool.flat
betula commentedon Jun 7, 2021
proposal: signal.union
Collect signals from several values and signals.
Worked as last value of set
22 remaining items
betula commentedon Jun 10, 2021
proposal: input as exportable api function
proposal: remove select.multiple
Improve "select" to "select.multiple" signature
The argument can be function, reactive container, object map, or array tuple.
proposal: reactive container as argument of "map" (and array of)
betula commentedon Jun 11, 2021
low: test ts typings
https://github.com/reduxjs/reselect/blob/master/typescript_test/test.ts#L479
betula commentedon Jun 12, 2021
fix: update component warn from modification in the render function
https://codesandbox.io/s/realar-api-unsubscribe-scopes-control-0sziu?file=/src/App.tsx
betula commentedon Jun 12, 2021
brainstorm: signals two directional synchronization
Signals connection without the infinity loop error
I should realize a way to the bi-directional connection between signals.
betula commentedon Jun 18, 2021
signal.from.select broken ts types with tuples
betula commentedon Jun 23, 2021
value(false) broken types for ts <4
betula commentedon Jun 23, 2021
proposal: manual rerun cycle outside
betula commentedon Jun 24, 2021
proposal: shortcut not
betula commentedon Jun 24, 2021
proposal: value with no initial parameter
betula commentedon Jun 24, 2021
proposal: typings improvement for filter
betula commentedon Jun 27, 2021
proposal: new Scope api
betula commentedon Jun 27, 2021
fix: callback of sync or to methods should be untracked ... hmm.. check it
betula commentedon Jun 27, 2021
fix: typings for select without parameter
betula commentedon Nov 8, 2021
proposel: value.will
betula commentedon Nov 15, 2021
proposal