Skip to content

Example on README doesn't show that the yield loadAs returns an array #131

Open
@CMCDragonkai

Description

@CMCDragonkai

Is the README example correct?

For example it says:

var commit = yield repo.loadAs("commit", commitHash);
var tree = yield repo.loadAs("tree", commit.tree);

But when I tried this, the commit was an array with the first element being an object containing tree, while the second element was just undefined.

I end up using the destructuring syntax let [commit] = ... to get around this, but what is the second element for? Even when I pass in a garbage commit hash, it's undefined (at first I thought it might be a [val, err] pattern).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions