Repository navigation
Replies: 4 comments 3 replies
|
I think you should put the line: let val = secondsLeft.valinside the clause of if statement of |
|
Ah..., I think I know what you're asking... Basically you want the binding function inside Object.assign(timer, timer)This is because in VanJS |
|
Peeking seems to be a useful feature anyway. I'm considering to add it in the next VanJS and VanX release. |
Uh oh!
There was an error while loading. Please reload this page.
I would like to peek at a state value without actually causing a DOM rerender. But I always want to have the latest value when the user interacts with the UI and the DOM actually needs to be updated. Is there already an existing way to do this? If not I could put in a feature request.
So, the example would be this website https://jon49.github.io/timer/van where I have a timer. If I start the timer and then update the time it shuts off the timer. It should keep going and the user can choose to stop the timer themselves.
Here's the code: https://github.com/jon49/timer/blob/1f2be3f01832e2f97e62d95bcb3be049b8bab3bf/src/app.ts#L134
An idea I had, if this feature doesn't already exist, is to have a prefix that you could use when accessing the values, e.g.,
data.$myValueand then the van library would know that I want to accessmyValuebut I don't want it to affect any rendering.All reactions