Skip to content

Instantly share code, notes, and snippets.

@ccapndave
Created October 19, 2016 10:39
Show Gist options
  • Save ccapndave/eb696a5c931d19ac9842a6c0ff235859 to your computer and use it in GitHub Desktop.
Save ccapndave/eb696a5c931d19ac9842a6c0ff235859 to your computer and use it in GitHub Desktop.
const shaHistory$ = O.create(o => {
const getNext = () => {
revwalk.next()
.then(value => {
if (value) {
o.onNext(value);
getNext();
} else {
o.onCompleted();
}
})
.catch(err => {
if (err.errno !== Git.Error.CODE.ITEROVER) {
o.onError(err);
} else {
o.onCompleted();
}
});
};
getNext();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment