Skip to content

Commit

Permalink
make userId optional and remove extra lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
aligg committed Dec 7, 2023
1 parent a3768f2 commit dcdf950
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/src/services/feature-flags/FeatureFlagManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class FeatureFlagManager {
this.client = new Evidently();
}

async isFeatureEnabled(featureName: string, userId: string) {
async isFeatureEnabled(featureName: string, userId?: string) {
const evalRequest = {
entityId: userId,
feature: featureName,
Expand Down
2 changes: 1 addition & 1 deletion app/src/services/feature-flags/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { manager } from "./setup";

export function isFeatureEnabled(feature: string, userId: string) {
export function isFeatureEnabled(feature: string, userId?: string) {
return manager.isFeatureEnabled(feature, userId);
}
2 changes: 1 addition & 1 deletion app/src/services/feature-flags/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FeatureFlagManager } from "./FeatureFlagManager";
import { LocalFeatureFlagManager } from "./LocalFeatureFlagManager";

export interface FlagManager {
isFeatureEnabled(feature: string, userId: string): Promise<boolean>;
isFeatureEnabled(feature: string, userId?: string): Promise<boolean>;
}

export const manager: FlagManager = process.env.FEATURE_FLAG_PROJECT
Expand Down
6 changes: 0 additions & 6 deletions package-lock.json

This file was deleted.

0 comments on commit dcdf950

Please sign in to comment.