Skip to content

Commit

Permalink
Remove changes to old docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LiquidSean committed Sep 18, 2019
1 parent bb4150a commit d773dfa
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions docs_3x.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,7 @@ Note: since this component will re-render its children every time its parent's p
There are 3 features that this library provides in order to leverage offline capabilities in your Redux store: a reducer, a middleware and an offline queue system. You can use all of them or just the ones that suits your needs.

### Network reducer
A network reducer to be provided to the store. The reducer can take an optional comparisonFn. If no function is provided default comparison function will be used.
```js
export default (
comparisonFn: Function = getSimilarActionInQueue,
) => (state: NetworkState = initialState, action: *) {
}
```
A network reducer to be provided to the store.

#### State
```js
Expand All @@ -172,31 +166,6 @@ const store = createStore(rootReducer);
export default store;
```

##### OR
```js
// configureStore.js
import { createStore, combineReducers } from 'redux'
import { reducer as network } from 'react-native-offline';
import { comparisonFn } from './utils';

const rootReducer = combineReducers({
// ... your other reducers here ...
network(comparisonFn),
});

const store = createStore(rootReducer);
export default store;
```

##### 1a. Comparison Function needs to accept an `action` and the `actionQueue`. The result of the function will be either `undefined` meaning no match found or the `action` that matches the passed in action.
```js
function comparisonFn(
action: *,
actionQueue: Array<*>,
) { }
```


##### 2.- Here you have 2 options:

##### 2a.- Wrap your top most React component into `withNetworkConnectivity` and configure it with `withRedux = true`.
Expand Down

0 comments on commit d773dfa

Please sign in to comment.