Skip to content

Commit c281dad

Browse files
author
jtassin
committed
add docuementation for debouncing mode
1 parent fbcaac1 commit c281dad

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ For Angular 2 see [ng2-redux](https://github.com/wbuchwalter/ng2-redux).
1717
- [API](#api)
1818
- [Dependency Injectable Middleware](#dependency-injectable-middleware)
1919
- [Routers](#routers)
20+
- [Debouncing the digest](#debouncing-the-digest)
2021
- [Using DevTools](#using-devtools)
2122
- [Additional Resources](#additional-resources)
2223

@@ -188,6 +189,24 @@ $ngReduxProvider.createStoreWith(reducers, [thunk, 'myInjectableMiddleware']);
188189

189190
Middlewares passed as **string** will then be resolved throught angular's injector.
190191

192+
## Debouncing the digest
193+
You can debounce the digest triggered by store modification (usefull in huge apps with a lot of store modification) by passing a config parameter to the `ngReduxProvider`.
194+
195+
```javascript
196+
import angular from 'angular';
197+
198+
angular.module('ngapplication').config(($ngReduxProvider) => {
199+
'ngInject';
200+
201+
// eslint-disable-next-line
202+
$ngReduxProvider.config.debounce = {
203+
wait: 100,
204+
};
205+
});
206+
```
207+
208+
This will debounce the digest 100ms. Every store modification within this time will be handled by this digest.
209+
191210
## Routers
192211
See [redux-ui-router](https://github.com/neilff/redux-ui-router) to make ng-redux and UI-Router work together. <br>
193212
See [ng-redux-router](https://github.com/amitport/ng-redux-router) to make ng-redux and angular-route work together.

0 commit comments

Comments
 (0)