Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CMCDragonkai opened this issue Jun 3, 2017 · 0 comments

Comments

@CMCDragonkai
Copy link

CMCDragonkai commented Jun 3, 2017

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).

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

No branches or pull requests

2 participants