-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add customer origin url fallback #37
Conversation
Is there a way to document the fetch options in a DRY way similar to typescript, but with our current tooling? const fetchOpts: object = {
cdnURL: string,
// etc
} The amount of potential options has grown and I feel the jsdoc method of listing individual fields is getting a bit hefty, especially since there's multiple methods that accept the same options object. EDIT: I guess |
src/client.js
Outdated
const jwt = await getJWT(this.opts, this.storage) | ||
options.jwt = jwt | ||
} | ||
options.format = opts.format ? opts.format : 'car' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will still return 'car'
when we pass { format: null }. Now i'm wondering if it's better to create a client side only 'flat'
format to avoid falsy checks defaulting to 'car', when in fact we want flat files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed this.
I think adding explicit file formats is better to identify flat
or car
. We only currently support car or flat though so I think the condition here is sufficient and we can change this later if needed if we start supporting more file formats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll eventually need to support raw
format too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want me to handle the file types explicitly in this PR or shall we do that later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets do another PR, this PR is too big already
4193415
to
af8071d
Compare
cc16417
to
4e50992
Compare
Changes:
originURL
if it exists to fetch data as a final fallback.