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
It seems that setScheduler(new RAFScheduler()) does not behave properly because the number of job objects are out of sync with the DOM objects that are created (more DOM object are created that actually exists in the jobs stream). The only way I can have the list of jobs synced with the DOM is by using syncRAF.
import{defAtom,defCursor}from"@thi.ng/atom";import*asrxfrom"@thi.ng/rstream";import{$compile,$list,setScheduler,RAFScheduler}from"@thi.ng/rdom";// setScheduler(new RAFScheduler());constdb=defAtom<State>({jobs: []});constjobs=defCursor(db,["jobs"]);constjobsView=rx.syncRAF(rx.fromAtom(jobs))constjobCreate=rx.stream<Job>();jobCreate.subscribe({next: ({ start, end, ...rest})=>{jobs.swap((prev)=>[
...prev,{ ...rest,start: newDate(start),end: end&&newDate(end)},]);},});tx.run(tx.sideEffect((x)=>jobCreate.next(x)),getJobs(),// not implemented here returns Job[]);constroot=document.getElementById("root")$compile($list(jobs,"div",{},(x)=>`${x.start}`)).mount(root)
The text was updated successfully, but these errors were encountered:
BREAKING CHANGE: remove scheduler, update IComponent and
various DOM update fn signatures
- remove scheduler support since never used (other than
default/dummy `NullScheduler`) and `RAFScheduler` logic is
better handled via `synRAF()` or similar (also see #402)
- update IComponent.mount() signature to use `ParentNode
as type for `parent` arg, e.g. to support use w/ `ShadowRoot`
- update various DOM update fns with same parent arg type
- update all utility components/wrappers
It seems that
setScheduler(new RAFScheduler())
does not behave properly because the number of job objects are out of sync with the DOM objects that are created (more DOM object are created that actually exists in the jobs stream). The only way I can have the list of jobs synced with the DOM is by usingsyncRAF
.The text was updated successfully, but these errors were encountered: