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
* Add minor optimization by checking `exists()` before calling `val()`
* Add `mergeProps` argument to `connect()`
* Change argument order to ownProps, subscriptionProps and actionProps
* Fix "Unknown prop `firebaseApp` on <div> tag" warning
* Pass firebaseProps to mergeProps instead of actionProps and subscriptionProps
* Clarify "actions" term in README
* Revert adding exists() to snapshot.val() check
* Only merge actions from firebaseProps before merging
* Improve tests
Connects a React component to a Firebase App reference.
44
44
@@ -48,10 +48,15 @@ It does not modify the component class passed to it. Instead, it *returns* a new
48
48
49
49
*[`mapFirebaseToProps(props, ref, firebaseApp): subscriptions`]\(*Object or Function*): Its result, or the argument itself must be a plain object. Each value must either be a path to a location in your database, a query object or a function. If you omit it, the default implementation just passes `firebaseApp` as a prop to your component.
50
50
51
+
52
+
*[`mergeProps(ownProps, firebaseProps): props`]\(*Function*): If specified, it is passed the parent `props` and current subscription state merged with the result of `mapFirebaseToProps()`. The plain object you return from it will be passed as props to the wrapped component. If you omit it, `Object.assign({}, ownProps, firebaseProps)` is used by default.
53
+
51
54
#### Returns
52
55
53
56
A React component class that passes subscriptions and actions as props to your component according to the specified options.
54
57
58
+
> Note: "actions" are any function values returned by `mapFirebaseToProps()` which are typically used to modify data in Firebase.
59
+
55
60
##### Static Properties
56
61
57
62
*`WrappedComponent`*(Component)*: The original component class passed to `connect()`.
0 commit comments