-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add pagination constants #41
Add pagination constants #41
Conversation
src/constants.ts
Outdated
CONTINUATION: 'continuation', | ||
}; | ||
|
||
export const PAGINATION_MAP = { |
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 are currently using this internally, I think we can abstract it a bit and add it here. I think we may need to address some of the terms, but I wanted thoughts before I went too far down this path.
I am open to either. I guess my question is how/why would someone need these strings? I think the real power in the other lookup I added. |
src/constants.ts
Outdated
@@ -0,0 +1,18 @@ | |||
export const PAGINATION_TYPE = { |
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.
Thinking I'm how this would get used:
import {PAGINATION_TYPE} from 'eventbrite';
const {PAGINATION} = PAGINATION_TYPE;
That seems a bit ugly.
How about:
import {PAGINATION_TYPE} from 'eventbrite';
? Which would mean we should do:
export const PAGINATION_TYPE = 'page';
export const CONTINUATION_TYPE = 'continuation';
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.
I am good with that.
src/constants.ts
Outdated
@@ -0,0 +1,2 @@ | |||
export const PAGINATION = 'page'; |
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.
How about naming them PAGE_KEY
& CONTINUATION_KEY
? Not sure what I'd expect to get if I import {PAGINATION} from 'eventbrite'
, but the string 'page'
seems surprising.
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.
The failure in Node 11 is probably due to outdated dependencies. If the upgrade is terrible, let's make a ticket and tackle it later. The nice thing is that now we know.
Nice, sounds good! I dunno how we wanna reconcile Github issues w/ internal Jira. Might need to create a Jira that just links to the Github issue? |
Yeah I thought about that not really sure. It will easily lose visibility being only in GH. |
🎉 This PR is included in version 1.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adding constants for our pagination methods.
Description
Used internally for a determining how to fetch the next page.
fixes: EB-94542
How Has This Been Tested?
Just constants so I didn't really test anything besides making sure
validate
passed.Screenshots (if appropriate):
Checklist:
yarn validate
to ensure that tests, typescript and linting are all in order.