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
Ported your logic to a Go project that needs reactivity.
All test pass and the results are very promising. I ported benchmark as well. Used it with no threading to try to be as close to 1:1 with the current numbers.
On my machine
Port
My question is more of understanding some of the details
It appears stale() puts things in the EffectQueue and stabilize() takes them out. But I don't see stabilize() called anyway in the repository.
When creating a reactive there is the option effect boolean. When and why should that be set? I'm familiar with Vue & Solid's computed vs effect but is it the same model here?
Thank you for the blog post and the work on this algorithm!
The text was updated successfully, but these errors were encountered:
Yep, we wanted a fully lazy system which allows flexibility for running all effects in an event loop in a game. However, you could pretty quickly add a batching system by adding a line after EffectQueue.push(this); to schedule a stabilize (i.e.
Yep, I was trying to fuse signals, computeds, and effects into one Reactive primitive, but I didn't entirely succeed in abstracting away here. Passing in a function into the first argument makes it a computed or effect, and setting the effect flag will make it automatically run when dependencies change. Otherwise it is a memo, and lazily runs but efficiently caches. In other words, just wrap all reactive values and functions in reactive, and when the functions should be rerun, pass in effect=true. (The reason this isn't the default is because sometimes you have many different outputs and you only want to sample one and not compute the others unless they are used)
Ported your logic to a Go project that needs reactivity.
All test pass and the results are very promising. I ported benchmark as well. Used it with no threading to try to be as close to 1:1 with the current numbers.
On my machine
Port
My question is more of understanding some of the details
stale()
puts things in theEffectQueue
andstabilize()
takes them out. But I don't seestabilize()
called anyway in the repository.The text was updated successfully, but these errors were encountered: