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
I'm just starting to use stimulus-use and it's great! Thanks for your work.
I've found myself with an issue with useTransition and the transitioned state. This state is being track on the js class instead on the DOM. Let me explain my case:
I have a sidebar that can can be opened/closed by two buttons. For that reason I'm instanciating the controller twice having each one of them tracking their own transitioned state. I think if we can persist this state in the target element (not in the controller element) in an attribute like data-transitioned-state, for example, then any controller instance will just read the current state from the element attribute.
This is also preferabe according the stimulus approach: "A Stimulus application’s state lives as attributes in the DOM; controllers themselves are largely stateless.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi!
I'm just starting to use
stimulus-use
and it's great! Thanks for your work.I've found myself with an issue with
useTransition
and thetransitioned
state. This state is being track on the js class instead on the DOM. Let me explain my case:I have a sidebar that can can be opened/closed by two buttons. For that reason I'm instanciating the controller twice having each one of them tracking their own
transitioned
state. I think if we can persist this state in the target element (not in the controller element) in an attribute likedata-transitioned-state
, for example, then any controller instance will just read the current state from the element attribute.This is also preferabe according the stimulus approach: "A Stimulus application’s state lives as attributes in the DOM; controllers themselves are largely stateless.
Thanks!
The text was updated successfully, but these errors were encountered: