Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Promises don't reject when the same promise is returned from a .then resolve #20

@wescravens

Description

@wescravens

Example:

var firebase = new Firebase(...)
var baseRef = newFireproof(firebase);

function addPost (post) {
  var newPostRef = baseRef.child('post').push(post);
  newPostRef.then(function () {
    newPostRef.child('childRef').set('value', 'something');
    return newPostRef; // If promise and x refer to the same object, reject promise with a TypeError as the reason.
  });
}

addPost({...}).then(function (newPostRef) {
  // use newPostRef
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions