Skip to content
Permalink
Branch: next
Commits on Sep 19, 2019
  1. Make sure useFetch rejects with an Error type. (#114)

    artdent authored and ghengeveld committed Sep 19, 2019
    * Make sure useFetch rejects with an Error type.
    
    Previously, a non-ok http response would reject with the response
    object. It's better for rejections to be of type Error so that the
    full stack trace information is available; plus, the TypeScript type
    definition assumes that the error object is always instanceof Error.
    
    Instead, failed responses reject with a FetchError, with the
    underlying Response object available as error.response.
    
    This is a backward-incompatible change: users who expected `error` to
    be of type Response now have to refer to `error.response` instead.
    
    * FetchError: add status code to the error message.
    
    * Define FetchError as a class, not just an interface.
    
    This is necessary for TypeScript code to be permitted to use
    FetchError as a value at runtime, e.g. to perform an `instanceof
    FetchError` check.
Commits on Sep 9, 2019
  1. Add a unit test for the createInstance displayName arg. (#108)

    artdent authored and ghengeveld committed Sep 9, 2019
Commits on Sep 6, 2019
  1. Add displayName to the createInstance type signature. (#102)

    artdent authored and ghengeveld committed Sep 6, 2019
You can’t perform that action at this time.