new FirebaseAdapter(opts)
FirebaseAdapter class.
Method parameters:
Name | Type | Argument | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
<optional> |
Configuration opts. Properties
|
Details
Source |
---|
src/index.js, line 58 |
Examples
import {DataStore} from 'js-data'
import firebase from 'firebase'
import {FirebaseAdapter} from 'js-data-firebase'
const store = new DataStore()
firebase.initializeApp({
apiKey: 'your-api-key',
databaseURL: 'your-database-url'
})
const adapter = new FirebaseAdapter({ db: firebase.database() })
store.registerAdapter('firebase', adapter, { 'default': true })
import {Container} from 'js-data'
import firebase from 'firebase'
import {FirebaseAdapter} from 'js-data-firebase'
const store = new Container()
firebase.initializeApp({
databaseURL: 'your-database-url',
serviceAccount: 'path/to/keyfile'
})
const adapter = new FirebaseAdapter({ db: firebase.database() })
store.registerAdapter('firebase', adapter, { 'default': true })
Members
-
<static> version
-
Details of the current version of the
js-data-firebase
module.DetailsType Source Object src/index.js, line 540 Properties:
Name Type Description version.full
String The full semver value.
version.major
Number The major version number.
version.minor
Number The minor version number.
version.patch
Number The patch version number.
version.alpha
String | Boolean The alpha version value, otherwise
false
if the current version is not alpha.version.beta
String | Boolean The beta version value, otherwise
false
if the current version is not beta. -
db
-
The database instance used by this adapter.
DetailsType Default value Source Object firebase.database()
src/index.js, line 96
Methods
-
<static> extend(instanceProps, classProps)
-
Alternative to ES6 class syntax for extending
FirebaseAdapter
.Method parameters:Name Type Argument Description instanceProps
Object <optional>
Properties that will be added to the prototype of the subclass.
classProps
Object <optional>
Properties that will be added as static properties to the subclass itself.
Return value:Type Description Constructor Subclass of
FirebaseAdapter
.DetailsSource src/index.js, line 123 Examplesclass MyFirebaseAdapter extends FirebaseAdapter {...} const adapter = new MyFirebaseAdapter()
var instanceProps = {...} var classProps = {...} var MyFirebaseAdapter = FirebaseAdapter.extend(instanceProps, classProps) var adapter = new MyFirebaseAdapter()