Hello.
I want to addListener to the marker and call the OnMarkerClick action as a callback function.
I tried using the `$actions.OnMarkerClick` code in the script, but it didn't work.
Help me.
file in Scripts is in a seperated context, you can't call the $actions in that file.
otherway, if you wanna add event listener, let do it in the initialize action of your Block.
I know this is an old post, but here is a workaround to call Client Actions in JavaScript from your Scripts folder:
1. Assign the Client Actions as input parameters:
2. In the Scripts folder, wrap those parameters in a function wrapper using apply().
This took inspiration from the SSE Reactive Client & Debounce Reactive Forge Components. Check them out to see how they call Client Actions in JavaScript from the Scripts folder.