Skip to content

2.1.0

Compare
Choose a tag to compare
@ivklgn ivklgn released this 02 Jul 09:03
· 10 commits to main since this release

https://www.npmjs.com/package/@young-aviator-club/remote-data/v/2.1.0

  1. better infer types in guards
if (RD.isSuccess(rd)) {
  rd; // infer RemoteDataSuccess
}
  1. call loading, when reloading not specified in fold
rd = RD.reloading();

RD.fold(rd, {
  notAsked: () => 'no data',
  loading: () => 'loading..', // call loading (!)
  success: (n: number) => String(10 + n),
})