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

Renaming accept-fulfill and future-promise in documentation #69

Closed
christopherliu opened this issue Jul 12, 2013 · 1 comment
Closed

Comments

@christopherliu
Copy link

The current polyfill implementation doesn't match the Readme:

function fetchJSON(filename) {
  // Return a Promise that represents the fetch:
  return new Promise(function(resolver){
    // The resolver is how a Future is satisfied. It has reject(), accept(),
    // and resolve() methods that your code can use to inform listeners with:
    var xhr = new XMLHttpRequest();
    xhr.open("GET", filename, true);
    xhr.send();
    xhr.onreadystatechange = function() {
      if (xhr.readyState == 4) {
        try {
          resolver.accept(JSON.parse(xhr.responseText));
        } catch(e) {
          resolver.reject(e);
        }
      }
    }
  });
}

There is no accept, only fulfill. Also noticed mentions of future not changed to promise. I'm in the middle of coding something now but I'll take a more detailed look at this later and possibly issue a pull.

@slightlyoff
Copy link
Owner

Good catch.

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

No branches or pull requests

2 participants