anyone know how to use intersection observer in a component in a custom event
Leon Marseglia
21 days ago
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
21 days ago
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
21 days ago
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
21 days ago
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
21 days ago
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
21 days ago
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
21 days ago
@Leon Marseglia
Lucas G
21 days ago
Just to clarify in case it was misunderstood, it doesn't need a workflow specifically
I was referring to those event flows
Leon Marseglia
21 days ago
ah got you
Lucas G
21 days ago
You would set your variable on the event flow in your custom action there
Leon Marseglia
21 days ago
so set the variable in the custom action?
Lucas G
21 days ago
in the activeSlideChanged flow there
Leon Marseglia
21 days ago
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