Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for detecting changes to flag overrides #23

Merged
merged 3 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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