INNER CODE UNIT · JavaScript
FirestackModule
fullstackreact/react-native-firestack · lib/firestackModule.js:31
export class FirestackModule {
constructor(refName, opts={}) {
invariant(refName && typeof refName !== 'undefined', 'No ref name passed');
this._refName = refName;
this._makeRef = opts.makeRef || identity;
const initialState = Object.assign({}, opts.initialState || defaultInitialState, {
listening: false,
items: []
})
this._localState = initialState;
this._types = createTypes(this._refName);
this._toObject = opts.toObject || defaultToObject
this._sortFn = opts.sortFn || defaultSortFn
this._onChange = opts.onChange || identity;