Skip to content

1.0.69 - The lazy update

Compare
Choose a tag to compare
@hazae41 hazae41 released this 08 Sep 17:31
· 757 commits to master since this release

BREAKING CHANGES

  • Scroll resources now need to have a Normalized type that extends the Data type
    To put it another way, your Data type must have an union with your data and your normalized data:
return XSWR.scroll<Data | string, Error, string>(url, fetcher)

This is because on scroll, previous pages are in normalized form, but the next page is in data form

newData = [...previousPages: Normalized[], nextPage: Data]

CHANGES

  • Object states are now lazy initialized on fetch(), mutate(), refetch(), scroll(), update()
  • Fixed bugs
  • Fixed types