open-feature / open-feature/swift-sdk

Support partial updates to EvaluationContext (update a single attribute without resetting)

Open
#82 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
31
Forks
14
Avg merge
1d 12h
Merged PRs (30d)
2

Description

Right now we have to recreate and set the entire EvaluationContext even if only one attribute changes. This is cumbersome and error-prone. Please add an API to update specific keys without rebuilding the whole context (e.g., updateEvaluationContext(key:value:), mergeEvaluationContext(_:), and optionally a remove method).

Why:
Consider a case when you want to pass a specific context from react native to ios native in hybrid env.
It would avoid doing repetitively context structure creation.
Simple for developers using open feature

Proposal:
Provide methods to set/merge individual attributes (and optionally delete), with shallow-replace semantics by default.

Contribution:
I’m happy to work on this and open a PR if this approach is acceptable.
If there is any already existing method and if i have missed it please let me know

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.