Skip to content

Add convenience method to strip promise methods from new refs #21

@wescravens

Description

@wescravens

Currently new refs created with the push method cannot be resolved in promise chain. Since the return from .push is an object with the prototype of Fireproof and a .then method, returning it from a promise callback will result in it being treated as a promise thus resolving with undefined since .push doesn't have a resolve value.

Temporary work around:

Fireproof.prototype.getRef = function () {
    let ref = new Fireproof(this._ref);
    delete ref.then;
    return ref;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions