Home Manual Reference Source Repository

Function

Static Public Summary
public

* create(path: *, fn: *): *

public

* get(path: *, key: *): * | any

Fetches a record specified by the key from the database

public

* getAll(path: *): * | any

Fetches entire snapshot of the database

public

* sync(path: *, mapEventToAction: {}, limit: number)

public

* update(path: *, key: *, payload: *): *

Static Public

public * create(path: *, fn: *): * source

import {create} from 'firebase-saga/src/index.js'

Params:

NameTypeAttributeDescription
path *
fn *

Return:

*

public * get(path: *, key: *): * | any source

import {get} from 'firebase-saga/src/index.js'

Fetches a record specified by the key from the database

Params:

NameTypeAttributeDescription
path *
key *

Return:

* | any

import { get } from 'firebase-saga';

const posts = yield call(get, 'posts', '1');

public * getAll(path: *): * | any source

import {getAll} from 'firebase-saga/src/index.js'

Fetches entire snapshot of the database

Params:

NameTypeAttributeDescription
path *

Return:

* | any

Example:

import { getAll } from 'firebase-saga';

const posts = yield call(getAll, 'posts');

public * sync(path: *, mapEventToAction: {}, limit: number) source

import {sync} from 'firebase-saga/src/index.js'

Params:

NameTypeAttributeDescription
path *
mapEventToAction {}
  • optional
  • default: {}
limit number
  • optional
  • default: 20

public * update(path: *, key: *, payload: *): * source

import {update} from 'firebase-saga/src/index.js'

Params:

NameTypeAttributeDescription
path *
key *
payload *

Return:

*