Integrating DOM Event Listeners with Effect Typescript

Is there a way to "effect-ify" (new word) things like eventListeners on the dom?

Ideally, i'm trying to make an onLoadHandler an effect, but i'm not sure how it fits into the model, without passing like
runPromise
to the callback in this scenario.

Would this be considered an okay pattern? Since an onLoad handler of a dom element would be the edge of a program?
Was this page helpful?