how to global x-data? , change two componets with same x-data #2178
-
Hi, im trying sync isLoading on a function to two components with same x-data to show a template with
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
If they are two separate components with their own x-data, Alpine.store is probably the easiest way to go. Alternatively, you could nest the two components under a parent component that has isLoading state and that parent state can be accessed/mutated by children components. |
Beta Was this translation helpful? Give feedback.
If they are two separate components with their own x-data, Alpine.store is probably the easiest way to go.
Alternatively, you could nest the two components under a parent component that has isLoading state and that parent state can be accessed/mutated by children components.