Open jamesplease opened 6 years ago
fetch's init option accepts 12 options.
init
Holen only accepts 5 of the 12. The additional 7 are:
mode
cache
redirect
referrer
referrerPolicy
integrity
keepalive
signal
Although these are used less, for full support of the fetch API, Holen should accept these as props.
I believe these propTypes and defaultProps would work:
propTypes
defaultProps
// propTypes { mode: PropTypes.oneOf([ 'same-origin', 'cors', 'no-cors', 'navigate', 'websocket' ]), cache: PropTypes.oneOf([ 'default', 'no-store', 'reload', 'no-cache', 'force-cache', 'only-if-cached' ]), redirect: PropTypes.oneOf(['manual', 'follow', 'error']), referrer: PropTypes.string, referrerPolicy: PropTypes.oneOf([ 'no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url', '' ]), integrity: PropTypes.string, keepalive: PropTypes.bool, // This requires checking for the existence of AbortSignal signal: PropTypes.instanceOf(AbortSignal) }
// defaultProps { referrerPolicy: '', integrity: '', referrer: 'about:client' }
At the very least, signal should be supported as that is used for aborting fetches 🙂 .
I'd be happy to make a PR for this if you're :+1: Let me know!
Sounds great.
fetch's
init
option accepts 12 options.Holen only accepts 5 of the 12. The additional 7 are:
mode
cache
redirect
referrer
referrerPolicy
integrity
keepalive
signal
Although these are used less, for full support of the fetch API, Holen should accept these as props.
I believe these
propTypes
anddefaultProps
would work:At the very least,
signal
should be supported as that is used for aborting fetches 🙂 .I'd be happy to make a PR for this if you're :+1: Let me know!