anyone know how to use intersection observer in a component in a custom event

  • leonmarseglia-1342607871539548170

    Leon Marseglia

    18 hours 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?
    1342607871766167602-Screenshot_2025-02-21_at_21.12.49.webp
  • lucasg-1342609539014590566

    Lucas G

    18 hours 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
  • leonmarseglia-1342611310348730449

    Leon Marseglia

    18 hours 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?
  • lucasg-1342611451705036893

    Lucas G

    18 hours 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?
  • leonmarseglia-1342611968997068883

    Leon Marseglia

    18 hours 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'
  • lucasg-1342612123620212798

    Lucas G

    18 hours 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
  • leonmarseglia-1342613145427906631

    Leon Marseglia

    17 hours ago

    1342613144975052850-Screenshot_2025-02-21_at_21.45.04.png
    1342613145348472943-Screenshot_2025-02-21_at_21.45.14.png
  • 1050046545166348348-@Leon Marseglia
    lucasg-1342613345924157480

    Lucas G

    17 hours ago

    Just to clarify in case it was misunderstood, it doesn't need a workflow specifically
  • I was referring to those event flows
  • leonmarseglia-1342613509858398399

    Leon Marseglia

    17 hours ago

    ah got you
  • lucasg-1342613515772362874

    Lucas G

    17 hours ago

    You would set your variable on the event flow in your custom action there
  • leonmarseglia-1342613599750852700

    Leon Marseglia

    17 hours ago

    so set the variable in the custom action?
  • lucasg-1342613658269778063

    Lucas G

    17 hours ago

    in the activeSlideChanged flow there
  • leonmarseglia-1342614132897349774

    Leon Marseglia

    17 hours 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
  • which is now the case right?
  • 1342614399780917348-Screenshot_2025-02-21_at_21.50.07.png
    1342614400191828108-Screenshot_2025-02-21_at_21.50.14.png
  • lucasg-1342614569016623190

    Lucas G

    17 hours ago

    A custom action does not need to be in a 'Workflow' (created on the right panel) to have an event flow, just to clarify
  • But otherwise, yeah that's how you can set variables from custom action events
  • leonmarseglia-1342614746360316016

    Leon Marseglia

    17 hours ago

    how do i do it without workflow
  • lucasg-1342614844029014127

    Lucas G

    17 hours ago

    From that button in the custom action
  • The way you're doing in that last screenshot. That button will be there no matter where the custom action is used
  • leonmarseglia-1342616602281250846

    Leon Marseglia

    17 hours ago

    so how i have it is good or?
  • hard to understand over message haha
  • lucasg-1342616914500780103

    Lucas G

    17 hours ago

    Yeah it'll work I'm just clarifying that the custom action does not have to be in a workflow, it can be used on its own
  • leonmarseglia-1342618159881916496

    Leon Marseglia

    17 hours ago

    My custom action specifically or customer actions in general?
  • Tod-1342618161610231819

    Tod

    17 hours ago

    Great energy @Leon Marseglia! Your continuous contribution to the toddle Community just made you advance to Community Level 6!
  • lucasg-1342618631485264015

    Lucas G

    17 hours ago

    In general

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.