Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
### Description

<!-- Write Your Description Here -->

### Questions
<!-- Only include questions that apply to your pull request -->
<!-- Write Your Description Here ^ -->
<!-- Some things that may be of interest to address:
- Will a new version need to be released or is this a docs change?
- Which version should this be published as a part of? ("ASAP", "no idea", and specific version number)

- Which version should this be published as a part of? ("ASAP", "no idea", and specific version number)
- Does this impact the external API?
- Will it need to be a breaking change?
- Will it need to be a breaking change? -->

### Check List
If not relevant to pull request, check off as complete

- [ ] All tests passing
- [ ] Docs updated with any changes or examples
- [ ] Added tests to ensure feature(s) work properly

### Relevant Issues
<!-- List Relevant Issues here like so:
* [#1](https://github.com/prescottprue/react-redux-firebase/issues/#1)
-->
<!-- List Relevant Issues here -->
<!-- * #1 -->
15 changes: 14 additions & 1 deletion book.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"gitbook": ">=3.2.1",
"title": "React Redux Firebase",
"plugins": ["edit-link", "prism", "-highlight", "github", "anchorjs"],
"plugins": ["edit-link", "prism", "-highlight", "github", "anchorjs", "versions-select"],
"pluginsConfig": {
"edit-link": {
"base": "https://github.com/prescottprue/react-redux-firebase/tree/master",
Expand All @@ -14,6 +14,19 @@
"styles": {
"website": "build/gitbook.css"
}
},
"versions": {
"gitbookConfigURL": "https://raw.githubusercontent.com/prescottprue/react-redux-firebase/v2.0.0/book.json",
"options": [
{
"value": "http://docs.react-redux-firebase.com/history/v1.4.0/",
"text": "Version 1.4.0"
},
{
"value": "http://docs.react-redux-firebase.com/history/v2.0.0/",
"text": "Version 2.0.0"
}
]
}
}
}
399 changes: 381 additions & 18 deletions docs/api/compose.md

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions docs/api/connect.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [firebaseConnect](#firebaseconnect)

## firebaseConnect
# firebaseConnect

**Extends React.Component**

Expand All @@ -13,7 +7,6 @@ to provided firebase paths using React's Lifecycle hooks.

**Parameters**

- `dataOrFn` (optional, default `[]`)
- `watchArray` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of objects or strings for paths to sync from Firebase. Can also be a function that returns the array. The function is passed the current props and the firebase object.

**Examples**
Expand Down
15 changes: 3 additions & 12 deletions docs/api/constants.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [actionsPrefix](#actionsprefix)
- [actionTypes](#actiontypes)

## actionsPrefix
# actionsPrefix

Prefix for all actions within library

Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)

**Examples**

```javascript
import { constants } from 'react-redux-firebase'
constants.actionsPrefix === '@@reactReduxFirebase' // true
```

## actionTypes
# actionTypes

Object containing all action types

Expand Down Expand Up @@ -50,7 +41,7 @@ import { actionTypes } from 'react-redux-firebase'
actionTypes.SET === '@@reactReduxFirebase/SET' // true
```

##
# defaultConfig

Default configuration options

Expand Down
43 changes: 16 additions & 27 deletions docs/api/helpers.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [isLoaded](#isloaded)
- [isEmpty](#isempty)
- [toJS](#tojs)
- [pathToJS](#pathtojs)
- [dataToJS](#datatojs)
- [orderedToJS](#orderedtojs)
- [customToJS](#customtojs)

## isLoaded
# isLoaded

Detect whether items are loaded yet or not

Expand All @@ -28,14 +16,14 @@ import { firebaseConnect, isLoaded, dataToJS } from 'react-redux-firebase'

Returns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not item is loaded

## isEmpty
# isEmpty

Detect whether items are empty or not

**Parameters**

- `data`
- `item` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Item to check loaded status of. A comma seperated list is also acceptable.
- `data`

**Examples**

Expand All @@ -47,7 +35,7 @@ import { firebaseConnect, isEmpty, dataToJS } from 'react-redux-firebase'

Returns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not item is empty

## toJS
# toJS

Convert Immutable Map to a Javascript object

Expand All @@ -59,16 +47,16 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer

Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data located at path within Immutable Map

## pathToJS
# pathToJS

Convert parameter from Immutable Map to a Javascript object

**Parameters**

- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
- `data`
- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path from state.firebase to convert to JS object
- `notSetValue` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** Value to use if data is not available
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)

**Examples**

Expand All @@ -81,19 +69,19 @@ import { firebaseConnect, pathToJS } from 'react-redux-firebase'

Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data located at path within Immutable Map

## dataToJS
# dataToJS

Convert parameter under "data" path of Immutable Map to a Javascript object.
**NOTE:** Setting a default value will cause `isLoaded` to always return true

**Parameters**

- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
- `data`
- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of parameter to load
- `notSetValue` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** Value to return if value is not
found in redux. This will cause `isLoaded` to always return true (since
value is set from the start).
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)

**Examples**

Expand All @@ -118,17 +106,17 @@ const defaultValue = {

Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data located at path within Immutable Map

## orderedToJS
# orderedToJS

Convert parameter under "ordered" path of Immutable Map to a
Javascript array. This preserves order set by query.

**Parameters**

- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
- `data`
- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of parameter to load
- `notSetValue` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** Value to return if value is not found
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)

**Examples**

Expand All @@ -141,14 +129,15 @@ import { firebaseConnect, orderedToJS } from 'react-redux-firebase'

Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data located at path within Immutable Map

##
# populatedDataToJS

Convert parameter under "data" path of Immutable Map to a
Javascript object with parameters populated based on populates array

**Parameters**

- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
- `data`
- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of parameter to load
- `populates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of populate objects
- `notSetValue` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** Value to return if value is not found
Expand Down Expand Up @@ -177,18 +166,18 @@ export default connect(({ firebase }) => ({

Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data located at path within Immutable Map

## customToJS
# customToJS

Load custom object from within store

**Parameters**

- `data`
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of parameter to load
- `customPath` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Part of store from which to load
- `data`
- `custom`
- `notSetValue` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** Value to return if value is not found
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
- `customPath` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Part of store from which to load

**Examples**

Expand Down
12 changes: 3 additions & 9 deletions docs/api/reducer.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [firebaseStateReducer](#firebasestatereducer)

## firebaseStateReducer
# firebaseStateReducer

Reducer for react redux firebase. This function is called
automatically by redux every time an action is fired. Based on which action
Expand All @@ -13,8 +7,8 @@ changes.

**Parameters**

- `state` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Current Redux State (optional, default `initialState`)
- `action` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Action which will modify state (optional, default `{}`)
- `state` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Current Redux State
- `action` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Action which will modify state
- `action.type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of Action being called
- `action.data` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of Action which will modify state

Expand Down
4 changes: 2 additions & 2 deletions docs/recipes/react-native.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ We are going to use the project name Devshare for example here. For your project

1. Make sure you import `RNGoogleSignin.h` in your `AppDelegate.m` like so:

```objc
```objectivec
// add this line before @implementation AppDelegate
#import <RNGoogleSignin/RNGoogleSignin.h>

Expand All @@ -259,7 +259,7 @@ Only one `openURL` method can be defined, so if you have multiple listeners whic

**AppDelegate.m:**

```objc
```objectivec
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

Expand Down