Skip to content

Releases: joanllenas/ngx-remotedata

v8.0.0

17 Nov 18:50
Compare
Choose a tag to compare

v7.0.1 was not working on Angular 13, so I'm releasing the exact same thing but as a major release.
At the same time, I have released v7.0.2 which fixes the issues with Angular 13.

v7.0.1

08 Nov 17:17
Compare
Choose a tag to compare
  • Ivy enabled

v7.0.0

14 Jun 17:11
Compare
Choose a tag to compare
  • Added Angular >= 13 support

v6.1.1

23 Sep 05:55
Compare
Choose a tag to compare

Exported RemoteData variant interfaces to avoid ...has or is using name 'NotAsked' | 'Success' | 'Failure' | 'InProgress' from external module ".../node_modules/ngx-remotedata/lib/remote-data" but cannot be named. errors.

v6.1.0

18 May 15:42
Compare
Choose a tag to compare

Features

Added two RxJs operators that filter values and narrow their types:

  • filterSuccess() (docs)
  • filterFailure() (docs)

v6.0.1

17 May 15:54
Compare
Choose a tag to compare

Fixes

  • Added more thorough checks to isRemoteData, isSuccess, isFailure, isInProgress and isNotAsked type guards.

v6.0.0

14 Mar 18:17
0b7a631
Compare
Choose a tag to compare

Migration

  • If you come from v5.0.0 you probably don't have to do anything.
  • If you come from v3.1.0 it's recommended to first install v5.0.0, which is a transitional release that marks old APIs as deprecated. After migrating all deprecations you can safely install v6.

In this release

  • Added chain() API. (docs)

Breaking changes

  • Removed all APIs that were marked as deprecated and replaced by new ones:
Old API New API
RemoteDataTags -
AnyRemoteData RemoteData<any, any>
NotAsked.of() notAsked()
InProgress.of() inProgress()
Failure.of() failure()
Success.of() success()
InProgress::value() InProgress::value
Failure::value() Failure::value
Failure::error() Failure::error
Success::value() Success::value
  • All RemoteData variants are plain JavaScript objects, so you won't be able to use instanceof to discriminate between them. Use the type guards or folds instead:

Type guards

type User = { email: string };
const myRemoteData: RemoteData<User> = failure('Something went wrong.', {
  email: '[email protected]'
});

// (...)

if (isFailure(myRemoteData)) {
  // Here myRemoteData is narrowed to Failure
  console.log(`This is the failure: ${myRemoteData.error}`);
  console.log(`I have some data: ${myRemoteData.value.email}`);
}

Fold

const rd = success('this is fine!');
const result = fold(
  () => 'not asked',
  val => 'in progress: ' + val,
  (error, value) => `failure: ${error} ${value}`,
  value => 'success: ' + value,
  rd
);
console.log(result); // success: this is fine!
  • If you were using the custom localStorageSyncReducer reducer to persist / rehydrate the store now it is not needed anymore, you can use the library without any hacks. Check the ngrx example in the demo app.

v5.1.0

07 Mar 08:52
Compare
Choose a tag to compare

Features

Added new RemoteData APIs:

v5.0.0

05 Mar 16:07
Compare
Choose a tag to compare

In this release:

v4 never existed. I skipped it by mistake. Sorry for the confusion.

This release should be mostly backwards compatible with v3.1.0, but there are a few accidental features that you may have breaking changes if you rely on them (see the breaking changes section below).

πŸ’ͺ Improved APIs:

  • successValue pipe: Added new optional defaultValue argument. (docs)
  • inProgressValue pipe: Added new optional defaultValue argument. (docs)
  • All RemoteData variants now expose a readonly tag property.

πŸ†• New APIs:

Check the API section for detailed information.

  • Constructor functions:
    • notAsked()
    • inProgress()
    • failure()
    • success()
  • Guard functions:
    • isNotAsked()
    • isInProgress()
    • isFailure()
    • isSuccess()
    • isRemoteData()
  • Extract functions:

πŸ‘‹ Deprecations:

  • Added deprecation messages to some APIs that will be removed in the next major release.

πŸš‘ Misc. Improvements

  • Addressed various issues related to Ts strict mode and templates strict mode compliance.
  • Improved documentation.
  • Increased test coverage.
  • Improved types.
  • Internally, the library and example app are compiled with Angular 11 and strict mode / strict templates.

πŸ’” BREAKING CHANGES:

  • If you relied on pipes transform() function throwing exceptions (via try{}catch()), you should be aware that from v5 on, null and undefined don't throw anymore because they are valid values.

🐞 Here be bugs

This release has touched a lot of stuff so, If you find any bugs, please consider opening an issue, I'll address it ASAP.
Thanks!

v3.1.0

15 Oct 07:20
Compare
Choose a tag to compare

Features

  • Added new anyIsNotAsked pipe (docs).