Skip to content

Commit c11dc78

Browse files
authored
v0.2.6
v0.2.6
2 parents 4761fe4 + 7c2da81 commit c11dc78

File tree

8 files changed

+32
-47
lines changed

8 files changed

+32
-47
lines changed

.codeclimate.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
languages:
2+
JavaScript: true
3+
4+
exclude_paths:
5+
- "lib/**"
6+
- "tests/**"
7+
- "examples/**"
8+
- "LICENSE.md"
9+
- "README.md"
10+
- "package.json"

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ If you're not, you can access the library on [unpkg](https://unpkg.com/redux-fir
2525

2626
## Complementary Package
2727

28-
Most likely, you'll want react bindings, for that you will need [react-redux-firebase](https://github.com/prescottprue/react-redux-firebase). You can install the current v2.0.0 version it by running:
28+
Most likely, you'll want react bindings, for that you will need [react-redux-firebase](https://github.com/prescottprue/react-redux-firebase). You can install the current version it by running:
2929

3030
```sh
31-
npm install --save react-redux-firebase@next
31+
npm install --save react-redux-firebase
3232
```
3333

3434
[react-redux-firebase](https://github.com/prescottprue/react-redux-firebase) provides [`withFirestore`](http://docs.react-redux-firebase.com/history/v2.0.0/docs/api/withFirestore.html) and [`firestoreConnect`](http://docs.react-redux-firebase.com/history/v2.0.0/docs/api/withFirestore.html) higher order components, which handle automatically calling `redux-firestore` internally based on component's lifecycle (i.e. mounting/un-mounting)
@@ -84,7 +84,7 @@ render(
8484

8585
##### Functional Components
8686

87-
It is common to make react components "stateless" meaning that the component is just a function. This can be useful, but then can limit usage of lifecycle hooks and other features of Component Classes. [`recompose` helps solve this](https://github.com/acdlite/recompose/blob/master/docs/API.md) by providing Higher Order Component functions such as `withContext`, `lifecycle`, and `withHandlers`.
87+
It is common to make react components "functional" meaning that the component is just a function instead of being a `class` which `extends React.Component`. This can be useful, but then can limit usage of lifecycle hooks and other features of Component Classes. [`recompose` helps solve this](https://github.com/acdlite/recompose/blob/master/docs/API.md) by providing Higher Order Component functions such as `withContext`, `lifecycle`, and `withHandlers`.
8888

8989
```js
9090
import { connect } from 'react-redux'

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-firestore",
3-
"version": "0.2.5",
3+
"version": "0.2.6",
44
"description": "Redux bindings for Firestore.",
55
"main": "lib/index.js",
66
"module": "es/index.js",
@@ -85,4 +85,4 @@
8585
]
8686
}
8787
]
88-
}
88+
}

src/utils/query.js

-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ export const detachListener = (firebase, dispatch, meta) => {
179179
if (firebase._.listeners[name]) {
180180
firebase._.listeners[name]();
181181
delete firebase._.listeners[name]; // eslint-disable-line no-param-reassign
182-
} else {
183-
console.warn(`Listener does not exist for ${name}`); // eslint-disable-line no-console
184182
}
185183

186184
dispatch({

test/unit/utils/query.spec.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { attachListener, getQueryConfigs, firestoreRef } from '../../../src/utils/query';
22

3-
let dispatch;
3+
let dispatch = sinon.spy();
44
let meta;
55
let result;
66

@@ -10,6 +10,21 @@ describe('query utils', () => {
1010
expect(attachListener).to.be.a('function');
1111
});
1212

13+
it('converts slash path to dot path', () => {
14+
attachListener({ _: { listeners: {} } }, dispatch, { collection: 'test' });
15+
expect(dispatch).to.be.calledOnce;
16+
});
17+
18+
it('throws if meta is not included', () => {
19+
expect(() => attachListener({}, dispatch))
20+
.to.Throw('Meta data is required to attach listener.');
21+
});
22+
23+
it('throws if _ variable is not defined on Firebase', () => {
24+
expect(() => attachListener({}, dispatch, { collection: 'test' }))
25+
.to.Throw('Internal Firebase object required to attach listener. Confirm that reduxFirestore enhancer was added when you were creating your store');
26+
});
27+
1328
describe('converts slash path to dot path', () => {
1429
beforeEach(() => {
1530
dispatch = sinon.spy();

tests/unit/utils/actions.spec.js

-10
This file was deleted.

tests/unit/utils/query.spec.js

-28
This file was deleted.

0 commit comments

Comments
 (0)