anyone know how to use intersection observer in a component in a custom event
Leon Marseglia
18 hours ago
Feb 21, 2025, 9:24 PM
anyone know how to use intersection observer in a component in a custom event and then getting the event to output and update a variable? I'm trying to update a variable when this is triggered but i don't see how i can update the variable as i would need an event on something to then be able to get the response right?
Lucas G
18 hours ago
Feb 21, 2025, 9:30 PM
Custom actions have an event you can use. If you added the event after the action was set up somewhere you won't see it though, you'll have to re-add it to the workflow
Leon Marseglia
18 hours ago
Feb 21, 2025, 9:38 PM
sorry Lucas that confused me haha. Can you break it down. so I have this custom action. how do i get the response into my component variable. i create a workflow in the component?
Lucas G
18 hours ago
Feb 21, 2025, 9:38 PM
Can you send a screenshot of where you are using the custom action? The custom action has an event which you can use to update your variable
I'm guessing it you are using the custom action onLod of the component?
Leon Marseglia
18 hours ago
Feb 21, 2025, 9:40 PM
well i was going to but then if it only does it on load then it won't trigger again when the user swipes right?
to reveal which item in the scroll is 'active'
Lucas G
18 hours ago
Feb 21, 2025, 9:41 PM
No, not necessarily
Observers stay until cleaned up, like event listeners, etc
Which is why they need to be properly cleaned or they can cause memory leaks
Leon Marseglia
17 hours ago
Feb 21, 2025, 9:45 PM
@Leon Marseglia
Lucas G
17 hours ago
Feb 21, 2025, 9:46 PM
Just to clarify in case it was misunderstood, it doesn't need a workflow specifically
I was referring to those event flows
Leon Marseglia
17 hours ago
Feb 21, 2025, 9:46 PM
ah got you
Lucas G
17 hours ago
Feb 21, 2025, 9:46 PM
You would set your variable on the event flow in your custom action there
Leon Marseglia
17 hours ago
Feb 21, 2025, 9:47 PM
so set the variable in the custom action?
Lucas G
17 hours ago
Feb 21, 2025, 9:47 PM
in the activeSlideChanged flow there
Leon Marseglia
17 hours ago
Feb 21, 2025, 9:49 PM
yeah so you to get it in an evernt flow it needs to be in a workflow though right?
cause that's what i'm struggling to get my head around
and you saying "event flow" has helped me articulate it!
so my issue is how do i get the custom action into an event flow where i can then update