Skip to content

Commit

Permalink
Merge branch 'master' of github.com:chrsi/audible
Browse files Browse the repository at this point in the history
  • Loading branch information
chrsi committed Oct 20, 2019
2 parents 8adf968 + ad3a818 commit 2327384
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ To overcome this issue, audible.js changes the configuration during runtime. Bef
Use the `audible.call` function to change the configuration during runtime.

```js
import audible from '@csiber/audible';

audible.call('/configuration/appsettings.json', options).then(postSnapOptions => {
const vm = new Vue(postSnapOptions);
});
Expand All @@ -32,6 +34,8 @@ The configuration target defines where the configuration will be stored. There a
### window
This target stores the configuration object to the global window object.
```js
import audible from '@csiber/audible';

audible.call('/configuration/appsettings.json', options, { target: 'window' }).then(postSnapOptions => {
const vm = new Vue(postSnapOptions);
});
Expand All @@ -45,14 +49,16 @@ console.log(window.apiUrl);
### provide/inject
This target provides the configuration with the provide/inject mechanism of Vue.
```js
import audible from '@csiber/audible';

audible.call('/configuration/appsettings.json', options, { target: 'inject' }).then(postSnapOptions => {
const vm = new Vue(postSnapOptions);
});
```

Usage:
```js
import { CONFIGURATION_PROVIDER } from 'audible';
import audible, { CONFIGURATION_PROVIDER } from '@csiber/audible';

Vue.component('sample', {
inject: { config: CONFIGURATION_PROVIDER },
Expand Down

0 comments on commit 2327384

Please sign in to comment.