Skip to content

Commit 7cfd027

Browse files
Update README.md
Add a 'Usage' section
1 parent 94d5357 commit 7cfd027

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,33 @@ be executed on specific states.
2626
- 😎 Checkout the [sample application](./integration)
2727
- 📝 Learn about updates from the [changelog](CHANGELOG.md)
2828

29+
### Usage
30+
31+
Call the <code>InterceptorStrategy.configure</code> fluent method from within the <code>NgxsStoragePluginModule</code>
32+
configuration.
33+
34+
```ts
35+
import { InterceptorStrategy } from '@ngxs-labs/storage-plugin-extension';
36+
37+
const strategy: InterceptorStrategy = new InterceptorStrategy([
38+
// Define your strategies here
39+
]);
40+
41+
@NgModule({
42+
// ...
43+
imports: [
44+
NgxsStoragePluginModule.forRoot(
45+
strategy.configure({
46+
// NgxsStoragePluginOptions
47+
})
48+
)
49+
],
50+
// ...
51+
})
52+
export class AppModule {}
53+
54+
```
55+
2956
### Delivery example
3057

3158
In this example we use the <code>InterceptorStrategy</code> class to configure
@@ -157,6 +184,8 @@ export const strategy: InterceptorStrategy = new InterceptorStrategy([
157184
`app.module.ts`
158185

159186
```ts
187+
import { strategy } from './configuration';
188+
160189
@NgModule({
161190
declarations: [AppComponent],
162191
imports: [

0 commit comments

Comments
 (0)