Side-effect counterpart to injectChannel. Instead of
returning a signal of buffered events, it invokes onEvent once per
event for as long as the owning component / service is alive — the
idiomatic place for analytics, logging, and other fire-and-forget
side effects.
injectChannelEffect(this.stream, ["lifecycle", "tools"], {
replay: false,
onEvent: (event) => sendAnalytics(event),
onError: (error) => logger.error(error),
});
Reactive channels / target / enabled signals re-bind the
subscription when they change. The underlying subscription is shared
(ref-counted) with any matching injectChannel consumer.
replay defaults to false (live-only); events buffered before the
effect attaches are not re-delivered.
Must be called from an injection context (component / directive /
service field initializer, or runInInjectionContext(...)).