You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.
I stumbled upon an issue where it would be useful to additionally have a bind method which does not take a context argument, but a function returning a context. It's useful when binding event emitters as some of the emitted events might have different context active based on event types.
What do you think, would there be room for such a method?
Rough sketch (naming, parameter types of the callback uncertain)
publicbind<T>(target: T,getContext: ()=>Context): T
Can you provide a motivating example of a usecase which requires such a feature? Not a theoretical explanation but an actual feature you would like to implement.
I stumbled upon an issue where it would be useful to additionally have a
bind
method which does not take a context argument, but a function returning a context. It's useful when binding event emitters as some of the emitted events might have different context active based on event types.What do you think, would there be room for such a method?
Rough sketch (naming, parameter types of the callback uncertain)
More context here: open-telemetry/opentelemetry-js#2037
The text was updated successfully, but these errors were encountered: