You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(reducer): `MERGE` action added and `SET` action to reverted to v1 behavior - #255
* feat(populate): population of ordered data - #239
* feat(populate) populate once queries - #256
* feat(auth): emptyOnLogin config option added (defaults to `true`) - #254
* feat(query): emit `NO_VALUE` for `once` queries that are empty - #265
* fix(populate) Fixed populate function to return null for null paths
* app instance handling now uses `firebase_` instead of `extendApp` (more functionality) - #250
* Removed no longer in use code from v1 (validateConfig)
Copy file name to clipboardExpand all lines: docs/api/compose.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Middleware that handles configuration (placed in redux's
11
11
12
12
**Parameters**
13
13
14
-
-`fbApp`
14
+
-`instance`
15
15
-`otherConfig`
16
16
17
17
**Properties**
@@ -29,6 +29,8 @@ Middleware that handles configuration (placed in redux's
29
29
sessions are stored (only if presense is set). Often set to `'sessions'` or `'onlineUsers'`.
30
30
-`config.updateProfileOnLogin`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to update
31
31
profile when logging in. (default: `false`)
32
+
-`config.resetBeforeLogin`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to empty profile
33
+
and auth state on login
32
34
-`config.enableRedirectHandling`**[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not to enable
-`config.onAuthStateChanged`**[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Function run when auth state
Copy file name to clipboardExpand all lines: docs/contributing.md
+72-6Lines changed: 72 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,76 @@
11
11
12
12
It is often convenient to run a local version of `react-redux-firebase` within a project to debug issues. The can be accomplished by doing the following:
13
13
14
-
1. Fork `react-redux-firebase` then cloning to your local machine (or download and unzip)
15
-
1. Run `npm link` within your local `react-redux-firebase` folder
16
-
1. Run `npm link react-redux-firebase` in your project (or one of the examples)
17
-
1. Run `npm run watch` in your local `react-redux-firebase` folder to run a watch server that will rebuild as you make changes
18
-
1. Your project should now be pointing to your local version of `react-redux-firebase`
14
+
1. Fork `react-redux-firebase` then clone to your local machine
15
+
1. Go into your local `react-redux-firebase` folder and run `npm link`
16
+
1. Go into your project or one of the examples and run `npm link react-redux-firebase`
17
+
1. Go Back in your `react-redux-firebase` folder
18
+
1. Add/Change some code (placing a simple `console.log` is a nice way to confirm things are working)
19
+
1. run `npm run build` to build a new version with your changes
20
+
1. Your local version should now run when using `react-redux-firebase` within your project
19
21
20
-
**NOTE** The `commonjs` version is what is build when using `npm run watch`. If using a different version, use `npm run build` to build after you make changes.
22
+
**NOTE**
23
+
`npm run watch` can be used in your local `react-redux-firebase` folder to run a watch server that will rebuild as you make changes. Only the `commonjs` version is rebuild when using `npm run watch`. If using a different version, such as the `es` version, add watch flag to specific npm build command (i.e. `npm run build:es -- --watch`) to only rebuild that version when files are changed.
Include symlinked version of react-redux-firebase in your babel-loader excludes:
32
+
33
+
**Webpack 1**
34
+
35
+
```js
36
+
{
37
+
loaders: [
38
+
{
39
+
test:/\.(js|jsx)$/,
40
+
exclude: [
41
+
/node_modules/,
42
+
/react-redux-firebase\/dist/, // browser version (most common in Webpack 1)
43
+
/react-redux-firebase\/lib/, // commonjs version
44
+
/react-redux-firebase\/es/// es version
45
+
],
46
+
loader:'babel',
47
+
query: {
48
+
cacheDirectory:true,
49
+
plugins: ['transform-decorators-legacy'],
50
+
presets: ['es2015', 'react']
51
+
}
52
+
}
53
+
]
54
+
55
+
}
56
+
```
57
+
58
+
**Webpack 2 & 3**
59
+
60
+
```js
61
+
{
62
+
rules: [
63
+
{
64
+
test:/\.(js|jsx)$/,
65
+
exclude: [
66
+
/node_modules/,
67
+
/react-redux-firebase\/es/// es version (since webpack 2/3 uses module field of package.json)
68
+
],
69
+
use: [
70
+
{
71
+
loader:'babel-loader',
72
+
query: {
73
+
cacheDirectory:true,
74
+
plugins: ['transform-decorators-legacy'],
75
+
presets: ['es2015', 'react']
76
+
}
77
+
}
78
+
]
79
+
}
80
+
]
81
+
}
82
+
```
83
+
84
+
**What Happened?**
85
+
86
+
This error most often appears due to Webpack config. A common pattern is to provide `exclude: [/node_modules/]` setting to [babel-loader](https://github.com/babel/babel-loader), which keeps the loader from transforming code within the `node_modules` folder. Now that we have used `npm link`, your project points to your local version of `react-redux-firebase` instead of the one in your `node_modules` folder, so we have to tell the loader to also exclude transforming `react-redux-firebase`.
Copy file name to clipboardExpand all lines: docs/queries.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,34 @@
1
1
# Queries
2
+
Query listeners are attached by using the `firebaseConnect` higher order component. `firebaseConnect` accepts an array of paths for which to create queries. When listening to paths, it is possible to modify the query with any of [Firebase's included query methods](https://firebase.google.com/docs/reference/js/firebase.database.Query).
2
3
3
-
When listening to paths, it is possible to modify the query with any of [Firebase's included query methods](https://firebase.google.com/docs/reference/js/firebase.database.Query). Below are examples using Firebase query methods as well as other methods that are included (such as 'populate').
4
+
**NOTE:**
5
+
By default the results of queries are stored in redux under the path of the query. If you would like to change where the query results are stored in redux, use [`storeAs` (more below)](#storeAs).
6
+
7
+
Below are examples using Firebase query methods as well as other methods that are included (such as 'populate').
8
+
9
+
`firebaseConnect` is a Higher Order Component (wraps a provided component) that attaches listeners to relevant paths on Firebase when mounting, and removes them when unmounting.
10
+
11
+
**storeAs**
12
+
13
+
Data is stored in redux under the path of the query for convince. This means that two different queries to the same path (i.e. `todos`) will both place data into `state.data.todos` even if their query parameters are different. If you would like to store your query somewhere else in redux, use `storeAs`:
14
+
15
+
```js
16
+
@firebaseConnect([
17
+
{
18
+
path:'todos',
19
+
storeAs:'myTodos', // place in redux under "myTodos"
0 commit comments