Adds an event handler to an event so the event handler runs when the event is emitted. Use
papi.network.getNetworkEvent to use a networked event with this hook.
Delivery is guarded per subscription: once the subscription is superseded (the event or
eventHandler reference changed) or the component unmounts, an emission that still arrives from
it — e.g. an emitter walking a snapshot of its handler list — is ignored rather than delivered to
eventHandler. An unsubscriber that throws during cleanup is logged rather than thrown, since
nothing can catch an error thrown from an effect cleanup.
Adds an event handler to an event so the event handler runs when the event is emitted. Use
papi.network.getNetworkEventto use a networked event with this hook.Delivery is guarded per subscription: once the subscription is superseded (the
eventoreventHandlerreference changed) or the component unmounts, an emission that still arrives from it — e.g. an emitter walking a snapshot of its handler list — is ignored rather than delivered toeventHandler. An unsubscriber that throws during cleanup is logged rather than thrown, since nothing can catch an error thrown from an effect cleanup.