Replies: 4 comments 3 replies
-
I think you should put the line: let val = secondsLeft.val inside the clause of if statement of |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
Peeking seems to be a useful feature anyway. I'm considering to add it in the next VanJS and VanX release. |
Beta Was this translation helpful? Give feedback.
-
Hi @jon49, With the release of VanJS Hope it can help your use case :-) |
Beta Was this translation helpful? Give feedback.
-
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.$myValue
and then the van library would know that I want to accessmyValue
but I don't want it to affect any rendering.Beta Was this translation helpful? Give feedback.
All reactions