Skip to content

Commit 6219748

Browse files
authored
Version v1.3.1 (#73)
* Multiple populates defaulting improved * Tests now in "tests" instead of "test" folder * Tests improved to cover more cases of multiple populates * Travis uses `sudo: false`
1 parent d8d3ee5 commit 6219748

21 files changed

+78
-33
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ language: node_js
33
node_js:
44
- "6"
55

6+
sudo: false
7+
68
branches:
79
only:
810
- master

docs/api/connect.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ _Data_
2323

2424
```javascript
2525
import { connect } from 'react-redux'
26-
import { firebaseConnect, helpers } from 'react-redux-firebase'
27-
const { dataToJS } = helpers
26+
import { firebaseConnect, dataToJS } from 'react-redux-firebase'
2827

2928
// sync /todos from firebase into redux
3029
const fbWrapped = firebaseConnect([

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "react-redux-firebase",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Redux integration for Firebase. Comes with a Higher Order Component for use with React.",
5-
"browser": "dist/redux.js",
5+
"browser": "dist/react-redux-firebase.js",
66
"main": "lib/index.js",
77
"module": "es/index.js",
88
"jsnext:main": "es/index.js",
99
"scripts": {
1010
"clean": "rimraf dist",
1111
"lint": "eslint src/** test/**",
1212
"lint:fix": "npm run lint -- --fix",
13-
"test": "mocha -R spec --compilers js:babel-core/register ./test/setup.js ./test/**/*.spec.js",
14-
"test:cov": "istanbul cover ./node_modules/mocha/bin/_mocha -- ./test/** --recursive --report lcov --compilers js:babel-register --require babel-polyfill",
13+
"test": "mocha -R spec --compilers js:babel-core/register ./tests/setup.js ./test/**/*.spec.js",
14+
"test:cov": "istanbul cover ./node_modules/mocha/bin/_mocha -- ./tests/** --recursive --report lcov --compilers js:babel-register --require babel-polyfill",
1515
"codecov": "cat coverage/*/lcov.info | codecov",
1616
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
1717
"build:es": "cross-env BABEL_ENV=es babel src --out-dir es",

src/connect.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import { getEventsFromInput, createCallable } from './utils'
1616
* export default firebaseConnect()(App)
1717
* @example <caption>Data</caption>
1818
* import { connect } from 'react-redux'
19-
* import { firebaseConnect, helpers } from 'react-redux-firebase'
20-
* const { dataToJS } = helpers
19+
* import { firebaseConnect, dataToJS } from 'react-redux-firebase'
2120
*
2221
* // sync /todos from firebase into redux
2322
* const fbWrapped = firebaseConnect([

src/helpers.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,8 @@ export const populatedDataToJS = (data, path, populates, notSetValue) => {
344344
}
345345
})
346346
}),
347-
(obj, v) => {
348-
// combine data from all populates to one object
349-
const combined = defaultsDeep(obj, v)
350-
return defaultsDeep(combined, dataToJS(data, path))
351-
})
347+
// combine data from all populates to one object starting with original data
348+
(obj, v) => defaultsDeep(v, obj), dataToJS(data, path))
352349
}
353350

354351
/**
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)