americanexpress / fetchye

✨ If you know how to use Fetch, you know how to use Fetchye [fetch-yae]. Simple React Hooks, Centralized Cache, Infinitely Extensible.
Apache License 2.0
43 stars 22 forks source link

feat(fetchye): support headers as a function #86

Closed code-forger closed 1 year ago

code-forger commented 1 year ago

Description

Support a way of passing 'dynamic headers'

Motivation and Context

This allows some headers to be created at the time the api call is actually made, including when the run function is called.

This significantly reduces the boiler plate required to otherwise achieve this functionality.

How Has This Been Tested?

Unit tests No existing tests failing proves this is fully backwards compatible

Types of Changes

Checklist:

What is the Impact to Developers Using Fetchye?

New feature

codesandbox-ci[bot] commented 1 year ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 520cd9738943d3855585bcde57dd0187639d139b:

Sandbox Source
quick-install Configuration
fetchye-provider-install Configuration
fetchye-redux-provider-install Configuration
nextjs-fetchye-ssr Configuration