Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Return not working. #50

Closed
DylanPiercey opened this issue Apr 26, 2016 · 3 comments
Closed

Return not working. #50

DylanPiercey opened this issue Apr 26, 2016 · 3 comments

Comments

@DylanPiercey
Copy link

DylanPiercey commented Apr 26, 2016

async ({ api }, user)=> {
    const userId = _.get(user, "_id");
    if (!userId) return; // This line is the issue.
    const res = await api(`user/${userId}`);
    return await res.json();
}

Becomes:

function (_ref, user) {
    var api, userId, res, data;
    return Promise.resolve().then(function () {
        api = _ref.api;
        userId = _.get(user, "_id");

        if (!!userId) {
            return Promise.resolve().then(function () {
                return api("user/" + userId);
            }).then(function (_resp) {
                res = _resp;
                return res.json();
            }).then(function (_resp) {
                data = _resp;

                return data;
            });
        }
    }).then(function () {});
}

This is ignoring the return value.

@marten-de-vries
Copy link
Collaborator

Thanks for your report. This seems a duplicate of #21. You could try to confirm that by running your example with the possible fix for that one in #43.

@DylanPiercey
Copy link
Author

@marten-de-vries Looks to be the same issue. Sorry for the duplicate!

@marten-de-vries
Copy link
Collaborator

Thanks for confirming!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants