Skip to content
Open
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
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ fireproof.auth('my_auth_token').then(function() {
})
```

### Async Functions

This library returns promises and will work well with async functions.

```javascript
// Pushing a record using an async function
var ref = fireproof.child('myref')
var pushref = ref.push({ /* some object */ })

// This is the key of the newly pushed location.
// Note that it is called on the result of ref.push, and not the result of an async function.
console.log(pushref.key())

var error = await pushref
if (error) {
console.error('Something went wrong pushing ' + pushref.key())
console.error(error)
}
```

## Support

IE back to 9.
Expand Down