Skip to content

Conversation

@zhiyuanliang-ms
Copy link
Member

@zhiyuanliang-ms zhiyuanliang-ms commented Feb 6, 2025

Why this PR?

#55

Support targeting context accessor pattern, align with other FM libraries

Usage

An example application can be found #105

const featureManager = new FeatureManager(provider, {targetingContextAccessor: () => ({ userId: "xxx", groups: [] }) });

If targeting context is explicitly provided within isEnabled or getVariant call, it will have the higher priority than the targeting context accessor. See the testcases and comment

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • src/feature-management/package-lock.json: Language not supported
  • src/feature-management/src/filter/TargetingFilter.ts: Evaluated as low risk

@zhiyuanliang-ms
Copy link
Member Author

Example are added in #105

@zhiyuanliang-ms zhiyuanliang-ms merged commit a7694d6 into preview Mar 26, 2025
3 checks passed
@zhiyuanliang-ms zhiyuanliang-ms deleted the zhiyuanliang/targeting-context-accessor branch March 26, 2025 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants