Skip to content

Commit

Permalink
Merge pull request #23 from codedbychavez/feature/flag-overrides-watc…
Browse files Browse the repository at this point in the history
…h-changes

Add option for detecting changes to flag overrides
  • Loading branch information
codedbychavez authored Jan 17, 2024
2 parents 7ffdbd5 + 5e8970a commit c1fe6c2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 23 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
"vue-tsc": "^1.8.5"
},
"dependencies": {
"configcat-common": "^9.1.0"
"configcat-common": "9.2.0"
}
}
17 changes: 4 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
import {
SettingValue,
FlagOverrides,
MapOverrideDataSource,
OverrideBehaviour,
createConsoleLogger
} from "configcat-common";

export {
default as ConfigCatPlugin,
type PluginOptions as ConfigCatPluginOptions
} from './plugins/ConfigCatPlugin';

export { default as FeatureWrapper } from './components/FeatureWrapper.vue';

export { createConsoleLogger };

export function createFlagOverridesFromMap(map: { [name: string]: NonNullable<SettingValue>; }, behaviour: OverrideBehaviour) {
return new FlagOverrides(new MapOverrideDataSource(map), behaviour);
}
export {
createConsoleLogger,
createFlagOverridesFromMap
} from "configcat-common";

// These exports should be kept in sync with the exports listed in the section "Public types for end users" of common-js/src/index.ts!

Expand Down
5 changes: 2 additions & 3 deletions src/plugins/ConfigCatPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as configcat from "configcat-common";
import { HttpConfigFetcher } from "./ConfigFetcher";
import { LocalStorageCache } from "./LocalStorageCache";
import { PollingMode } from "configcat-common";
import { PollingMode, getClient } from "configcat-common";
import CONFIGCAT_SDK_VERSION from "./Version";
// Types
import type { App } from "vue";
Expand All @@ -28,7 +27,7 @@ export default {
configFetcher: new HttpConfigFetcher(),
});

const configCatClient = configcat.getClient(
const configCatClient = getClient(
sdkKey,
pollingMode ?? PollingMode.AutoPoll,
clientOptions,
Expand Down

0 comments on commit c1fe6c2

Please sign in to comment.