humanmade / repress

Connect your Redux store to the WordPress REST API.
Other
83 stars 11 forks source link

Add manual pagination #41

Closed rmccue closed 5 years ago

rmccue commented 5 years ago

Fixes #17.

Adds a new HOC (withPagedArchive) to handle manual pagination, where the page is passed via the page property (customisable via an options param).

Adds getPagedArchive into the handler to facilitate retrieving specific pages. (fetchMore is continuing to be used for loading them in.)

To support this, the state now contains a archivesByPage data store. In Repress Next (#36) we should combine archives, archivePages, and archivesByPage into a single item in the state instead, as archives is now a redundant store of the combined subobjects in archivesByPage.