File tree 2 files changed +7
-13
lines changed 2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 1
1
import { moduleFactory } from './module' ;
2
2
import FlagsmithFeature from './FlagsmithFeature.vue' ;
3
3
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' ;
6
6
if ( ! store ) {
7
7
throw new Error ( 'Please initialize plugin with a Vuex store.' ) ;
8
8
}
9
9
10
10
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 } ) ) ;
15
12
Vue . component ( 'flagsmith-feature' , FlagsmithFeature ) ;
16
13
store . dispatch ( 'flagsmith/fetch' ) ;
17
14
} ;
Original file line number Diff line number Diff line change @@ -7,14 +7,11 @@ const moduleFactory = ({ host, environmentId }) => ({
7
7
commit ( 'setLoading' , true ) ;
8
8
9
9
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
16
13
}
17
- ) ;
14
+ } ) ;
18
15
19
16
commit ( 'setFeatureFlags' , data ) ;
20
17
} catch ( e ) {
You can’t perform that action at this time.
0 commit comments