REST pagination bindings
Adapter design. This page specifies the unpublished adapter. Run a request with Octokit and Effect.
Keep the familiar paginate(routeOrMethod, params?, mapFn?) collection call and paginate.iterator(...) page form. Expose pages for a stream of normalized responses and items for a flattened stream. Preserve the endpoint-options-object overload (including its optional mapper). Accept named endpoint functions as well as route strings, including a bound effectified endpoint via its underlying Octokit callable. Derive types from the pagination plugin’s declarations. The SDK supports mapper-as-second-argument and early done(); retain mapped values from the stopping page. Keep sync mapper compatibility. Effectful mapping belongs in Stream combinators.
Use Octokit’s page traversal and normalization. Preserve array metadata such as total count, incomplete search results and repository selection. The plugin also has a synthetic empty-page path for a 409 and special traversal for commit comparisons. A normalized page may differ from the raw REST response. An arbitrary list-like method is insufficient evidence of pagination support. The catalogue distinguishes known routes.
Measured trap. Version 14.0.0 calls the page method with only method, URL and headers. A signal nested in the iterator’s initial parameters disappeared on both fetches in a two-page fake-transport run. Supplying a named endpoint defaulted with the signal preserved it on both. Scope the page request method per stream run. Preserve its endpoint metadata, configured fetch, decorated behavior and caller options; verify signal delivery at the transport for both string and method forms, including two concurrent consumers. Never mutate client defaults or reimplement Link parsing to work around it.
Check. Exercise normalized and plain arrays, empty repository, commit comparison, map/done, non-default fetch, early termination and second-page failure. Iterator · Normalization · Shared stream contract