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

fix: always return the same value when resolving requests multiple times #522

Merged
merged 5 commits into from
Aug 15, 2024

Commits on Aug 15, 2024

  1. fix: do not warn if callback argument was passed

    We shouldn't warn if the user does something like:
    
    fetchr.read('foo', { id: 42 });
    
    We were doing it since internally we were calling end with an
    undefined callback.
    pablopalacios committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    04b9ae3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5503f93 View commit details
    Browse the repository at this point in the history
  3. tests: cleanup functional tests

    - Fetchr({}) => Fetchr()
    - .read('foo', null) => .read('foo')
    pablopalacios committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    4fc5d43 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fec3e1b View commit details
    Browse the repository at this point in the history
  5. fix: return the same value when resolving request multiple times

    Before this commit, when calling fetchr on the client using the
    promise API and resolving it multiple times would lead to undefined
    values.
    
    We now make sure to always return the fetch promise in
    httpRequest. But doing so, broke the abort behavior since we would not
    return an FetchrHttpRequest to the user from fetchr methods. To fix
    that, we now save an instance of FetchrHttpRequest in the Request
    class and added an abort method to the later one to call
    FetchrHttpRequest.abort method.
    pablopalacios committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    34b6d4b View commit details
    Browse the repository at this point in the history