MCPcopy
hub / github.com/reduxjs/redux / getNextPageUrl

Function getNextPageUrl

examples/real-world/src/middleware/api.js:5–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4// Extracts the next page URL from Github API response.
5const getNextPageUrl = response => {
6 const link = response.headers.get('link')
7 if (!link) {
8 return null
9 }
10
11 const nextLink = link.split(',').find(s => s.indexOf('rel="next"') > -1)
12 if (!nextLink) {
13 return null
14 }
15
16 return nextLink.trim().split(';')[0].slice(1, -1)
17}
18
19const API_ROOT = 'https://api.github.com/'
20

Callers 1

callApiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected