Skip to content

2.8.1

Latest
Compare
Choose a tag to compare
@elbywan elbywan released this 07 Mar 07:37

2.8.1 (2024-03-07)

🐛 Bug fix(es)

  • Fix error callback type missing addons extensions (99a21a8), closes #222
export const apiClient = wretch('https://localhost:3000')
  .addon(QueryStringAddon)
  .resolve((chain) => {
    return chain.unauthorized((_error, request) => {
      // request type used to be wrong (missing .query() from the addon)
      // and it would clash with what was expected by the callback definition
      // now the type should be correct ✨ 
      return request
        .fetch()
        .unauthorized((error) => {
          throw error;
        })
        .json();
    });
  });

⬆️ Version update(s)

  • Bump follow-redirects from 1.15.1 to 1.15.4 (04fada6)