flexyford / impagination

A lazy data layer for your paged records
102 stars 7 forks source link

Immutable states lazy interfaces #35

Closed flexyford closed 7 years ago

flexyford commented 8 years ago

Dataset API

There are a number of public impagination functions which we provide as actions to update the dataset and store.

Updating the Dataset

Actions Parameters Description
refilter [filterCallback] Reapplies the filter for all resolved pages. If filterCallback is provided, applies and sets the new filter.
reset [offset] Unfetches all pages and empties the store. If offset is provided, fetches records at starting at offset.
setReadOffset [offset] Sets the readOffset and fetches records resuming at offset

Updating the Store

Actions Parameters Defaults Description
post data, index index = 0 Inserts data into store at index.
put data, index index = store.readOffset Merges data into record at index.
delete index index= store.readOffset Deletes data from store at index.

TODO