Skip to content

Commit 8e7983a

Browse files
update dependencies
1 parent 6669118 commit 8e7983a

11 files changed

+60
-70
lines changed

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@
2828
"author": "Michael Contento <[email protected]>",
2929
"license": "MIT",
3030
"devDependencies": {
31-
"babel-cli": "^6.1.4",
32-
"babel-core": "^6.1.4",
33-
"babel-eslint": "^4.1.5",
34-
"babel-polyfill": "^6.1.4",
31+
"babel-cli": "^6.3.15",
32+
"babel-core": "^6.3.15",
33+
"babel-polyfill": "^6.3.14",
3534
"babel-preset-michaelcontento": "^1.0.0",
36-
"eslint": "^1.9.0",
37-
"eslint-config-airbnb": "^1.0.0",
38-
"eslint-config-michaelcontento": "^1.0.0",
35+
"eslint": "^1.10.3",
36+
"eslint-config-michaelcontento": "^1.1.1",
3937
"eslint-plugin-mocha-only": "0.0.3",
4038
"mocca": "^0.2.2",
4139
"release-it": "^2.3.1"

src/__tests__/reducer-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ describe('reducer', () => {
3838
it('should not convert arrays to objects', () => {
3939
const spy = sinon.spy();
4040
const oldState = {};
41-
const action = { type: LOAD, payload: { arr: [ 1, 2 ] } };
41+
const action = { type: LOAD, payload: { arr: [1, 2] } };
4242

4343
reducer(spy)(oldState, action);
4444

45-
spy.should.have.been.calledWith({ arr: [ 1, 2 ] }, action);
45+
spy.should.have.been.calledWith({ arr: [1, 2] }, action);
4646
});
4747

4848
it('should overwrite changed arrays', () => {
4949
const spy = sinon.spy();
50-
const oldState = { arr: [ 1, 2 ] };
51-
const action = { type: LOAD, payload: { arr: [ 3, 4 ] } };
50+
const oldState = { arr: [1, 2] };
51+
const action = { type: LOAD, payload: { arr: [3, 4] } };
5252

5353
reducer(spy)(oldState, action);
5454

55-
spy.should.have.been.calledWith({ arr: [ 3, 4 ] }, action);
55+
spy.should.have.been.calledWith({ arr: [3, 4] }, action);
5656
});
5757
});
5858

src/createLoader.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { load as actionLoad } from './actions';
22

3-
export default function(engine) {
4-
return (store) => {
5-
const dispatchLoad = (state) => store.dispatch(actionLoad(state));
6-
return engine.load().then((newState) => {
7-
dispatchLoad(newState);
8-
return newState;
9-
});
10-
};
11-
}
3+
export default (engine) => (store) => {
4+
const dispatchLoad = (state) => store.dispatch(actionLoad(state));
5+
return engine.load().then((newState) => {
6+
dispatchLoad(newState);
7+
return newState;
8+
});
9+
};

src/createMiddleware.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function warnAboutConfusingFiltering(blacklist, whitelist) {
1515
});
1616
}
1717

18-
export default function(engine, actionBlacklist = [], actionWhitelist = []) {
18+
export default (engine, actionBlacklist = [], actionWhitelist = []) => {
1919
// Also don't save if we process our own actions
2020
const blacklistedActions = [...actionBlacklist, LOAD, SAVE];
2121

@@ -42,4 +42,4 @@ export default function(engine, actionBlacklist = [], actionWhitelist = []) {
4242
return result;
4343
};
4444
};
45-
}
45+
};

src/decorators/debounce.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function(engine, ms) {
1+
export default (engine, ms) => {
22
let lastTimeout;
33
let lastReject;
44

@@ -23,4 +23,4 @@ export default function(engine, ms) {
2323
});
2424
}
2525
};
26-
}
26+
};

src/decorators/filter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import set from 'lodash.set';
22
import isFunction from 'lodash.isfunction';
33

4-
export default function(engine, whitelist = []) {
4+
export default (engine, whitelist = []) => {
55
return {
66
load() {
77
return engine.load();
@@ -41,4 +41,4 @@ export default function(engine, whitelist = []) {
4141
return engine.save(saveState);
4242
}
4343
};
44-
}
44+
};

src/decorators/immutablejs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { fromJS } from 'immutable';
22

3-
export default function(engine, whitelist = []) {
3+
export default (engine, whitelist = []) => {
44
return {
55
load() {
66
return engine.load().then((result) => {
@@ -15,4 +15,4 @@ export default function(engine, whitelist = []) {
1515
return engine.save(state);
1616
}
1717
};
18-
}
18+
};

src/engines/localStorage.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
export default function(key) {
2-
return {
3-
load() {
4-
const jsonState = localStorage.getItem(key);
5-
return Promise.resolve(JSON.parse(jsonState) || {});
6-
},
1+
export default (key) => ({
2+
load() {
3+
const jsonState = localStorage.getItem(key);
4+
return Promise.resolve(JSON.parse(jsonState) || {});
5+
},
76

8-
save(state) {
9-
const jsonState = JSON.stringify(state);
10-
localStorage.setItem(key, jsonState);
11-
return Promise.resolve();
12-
}
13-
};
14-
}
7+
save(state) {
8+
const jsonState = JSON.stringify(state);
9+
localStorage.setItem(key, jsonState);
10+
return Promise.resolve();
11+
}
12+
});

src/engines/localStorageFakePromise.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,16 @@ function createFakePromise(thenResult) {
1010
};
1111
}
1212

13-
export default function(key) {
14-
return {
15-
load() {
16-
const jsonState = localStorage.getItem(key);
17-
const jsonObj = JSON.parse(jsonState) || {};
18-
return createFakePromise(jsonObj);
19-
},
13+
export default (key) => ({
14+
load() {
15+
const jsonState = localStorage.getItem(key);
16+
const jsonObj = JSON.parse(jsonState) || {};
17+
return createFakePromise(jsonObj);
18+
},
2019

21-
save(state) {
22-
const jsonState = JSON.stringify(state);
23-
localStorage.setItem(key, jsonState);
24-
return createFakePromise();
25-
}
26-
};
27-
}
20+
save(state) {
21+
const jsonState = JSON.stringify(state);
22+
localStorage.setItem(key, jsonState);
23+
return createFakePromise();
24+
}
25+
});
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { AsyncStorage } from 'react-native';
22

3-
export default function(key) {
4-
return {
5-
load() {
6-
return AsyncStorage.getItem(key)
7-
.then((jsonState) => JSON.parse(jsonState) || {});
8-
},
3+
export default (key) => ({
4+
load() {
5+
return AsyncStorage.getItem(key)
6+
.then((jsonState) => JSON.parse(jsonState) || {});
7+
},
98

10-
save(state) {
11-
const jsonState = JSON.stringify(state);
12-
return AsyncStorage.setItem(key, jsonState);
13-
}
14-
};
15-
}
9+
save(state) {
10+
const jsonState = JSON.stringify(state);
11+
return AsyncStorage.setItem(key, jsonState);
12+
}
13+
});

src/reducer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ function myMerge(oldState, newState) {
5151
return result;
5252
}
5353

54-
export default function(reducer) {
54+
export default (reducer) => {
5555
return (state, action) => reducer(
5656
action.type === LOAD
5757
? myMerge(state, action.payload)
5858
: state,
5959
action
6060
);
61-
}
61+
};

0 commit comments

Comments
 (0)