Paginated fetching of event data from the EveryAction API. It consists of:
- Proxy Server (Serverless function / Node endpoint)
- Vue.js Component that handles state and UI for displaying paginated events
- Goal: Show events in smaller, more manageable batches, giving the user the option to load more if needed.
- Technologies:
- Vue.js for the front-end UI.
- Axios for HTTP requests.
- Node.js / Serverless Function as a proxy to the EveryAction API.
- EveryAction API for the event data source.
-
Server-Side Pagination Parameters
- The serverless (proxy) endpoint accepts a
pagequery parameter and calculatesskip = page * pageSize. - Queries EveryAction with
&$top=pageSize&$skip=skipto fetch the correct slice of events. - Returns a JSON response containing:
items: Array of events for the current page.hasMoreornextPageLink(optional): Indicates if additional pages remain.
- The serverless (proxy) endpoint accepts a
-
Vue.js Pagination State
- Maintains
currentPage,hasMore,loading, and an array ofevents. - Calls the proxy endpoint with
?page=${currentPage}to fetch additional pages. - Shows a “Load More” button if more events are available.
- Maintains
-
Responsive Event List
- Displays a small batch (e.g., 10 events) initially, then appends more on demand.
- Improves performance, especially if the total number of events is large.