get-firebase-ref
v1.1.1
Published
Get a Firebase ref from a query and firebase module (web or admin)
Downloads
48
Readme
Get Firebase Ref
Get a Firebase ref to a firebase node from a query and firebase module (web, react-native or admin)
Install
yarn add get-firebase-ref
Usage
Provides getFirebaseRef function as default and named exports
import { getFirebaseRef } from "get-firebase-ref";
import firebase from "firebase/app";
import "firebase/database";
const ref = getFirebaseRef({ firebase, path: "posts/", limitToFirst: 10 });
API
Input
A Firebase Query :
export interface FirebaseQuery {
firebase?: any;
path: string;
orderByChild?: null | string;
orderByKey?: null | any;
orderByValue?: null | any;
limitToFirst?: null | number;
limitToLast?: null | number;
startAt?: null | number;
endAt?: null | number;
equalTo?: null | any;
keysOnly?: boolean;
once?: boolean;
isList?: boolean;
}
Output
A Firebase ref