Skip to content

Commit b014036

Browse files
committed
format files
1 parent 5635d8d commit b014036

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

src/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import { moduleFactory } from './module';
22
import FlagsmithFeature from './FlagsmithFeature.vue';
33

4-
const install = (Vue, { environmentId, store ,host }) => {
5-
const defaultHost= "https://api.flagsmith.com"
4+
const install = (Vue, { environmentId, store, host }) => {
5+
const defaultHost = 'https://api.flagsmith.com';
66
if (!store) {
77
throw new Error('Please initialize plugin with a Vuex store.');
88
}
99

1010
Vue.config.applicationHostname = 'localhost';
11-
store.registerModule(
12-
'flagsmith',
13-
moduleFactory({ environmentId,host:host||defaultHost })
14-
);
11+
store.registerModule('flagsmith', moduleFactory({ environmentId, host: host || defaultHost }));
1512
Vue.component('flagsmith-feature', FlagsmithFeature);
1613
store.dispatch('flagsmith/fetch');
1714
};

src/module.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ const moduleFactory = ({ host, environmentId }) => ({
77
commit('setLoading', true);
88

99
try {
10-
const { data } = await axios.get(
11-
`${host}/api/v1/flags`,
12-
{
13-
headers: {
14-
'X-Environment-Key': environmentId,
15-
}
10+
const { data } = await axios.get(`${host}/api/v1/flags`, {
11+
headers: {
12+
'X-Environment-Key': environmentId
1613
}
17-
);
14+
});
1815

1916
commit('setFeatureFlags', data);
2017
} catch (e) {

0 commit comments

Comments
 (0)