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
fix(experimental): Add experimental LDScopedClient for incrementally building and propagating contexts (#297)
You can now create a "scoped client", a wrapper of the client that will
use the specified context for all operations, including feature flag
evaluations and event tracking. This facilitates propagating a context
down to all logic that is related to a scoped piece of logic, like a web
request.
An `LDScopedClient` implements most of the same methods as `LDClient`,
but without the `context` argument.
A scoped client is mutable, to facilitate incrementally building up a
multi-context representing the current scope. You can add new contexts
(as long as they aren't replacing an existing kind) with
`LDScopedClient.AddContext`, and all contexts added so far will be
combined into a multi-context whenever the scoped client is used.
`LDScopedClient.OverwriteContextByKind` is offered as an escape hatch if
you need to update existing data.
---------
Co-authored-by: Matthew M. Keeler <[email protected]>
0 commit comments