Skip to content

Releases: e-oz/ngx-collection

3.1.0

10 Jul 13:23
Compare
Choose a tag to compare
  • New method to replace previously removed postInit(): asyncInit(). Will be called in the next microtask from the constructor (init() will be called first).
  • Collection.constructor() will complain in dev mode, if the comparator has to use default id fields, because no custom id fields are provided and no custom comparator is provided - that's exactly why Collection is not @Injectable anymore: providing this information is critically important for the correct functioning of Collection, so comparator fields (or a custom comparator) should be set explicitly. This error will help you not forget about it but will not pollute the console in production mode.

3.0.1

10 Jul 05:32
Compare
Choose a tag to compare

New helper: effect() function.
Copy of effect() method of NgRx ComponentStore, where takeUntil(this.destroy$) is replaced with takeUntilDestroyed(destroyRef), to use it as a function.

3.0.0

09 Jul 13:13
Compare
Choose a tag to compare

Breaking changes:

  • Observable-based version removed;
  • CollectionCore renamed to CollectionInterface;
  • Fields, containing signals now prefixed with '$' ($items, $totalCountFetched, $isUpdating and so on);
  • Methods don't accept observables anymore:
    • isItemDeleting()
    • isItemRefreshing()
    • isItemUpdating()
    • isItemMutating()
    • isItemProcessing()
  • Collection class is not @Injectable anymore. Easiest way to create an injectable class is to extend Collection with an @Injectable class;
  • NGX_COLLECTION_OPTIONS token removed - set options using constructor() or setOptions();
  • Default value for onDuplicateErrCallbackParam changed from {status: 409} to DuplicateError object;
  • postInit() method removed - you can declare your own and call it as Promise.resolve().then(() => this.postInit()); from init() if needed;
  • CollectionManager merged back to Collection.

2.3.2

09 Jul 07:32
Compare
Choose a tag to compare

getItemByPartial() is now part of the API.

2.3.1

05 Jun 10:36
Compare
Choose a tag to compare
  • Signal-based collection: processingItems: Signal<T[]> field has been added;
  • Observable-based collection: processingItems$: Observable<T[]>, processingItemsSignal: Signal<T[]> fields have been added.

2.3.0

26 May 11:25
Compare
Choose a tag to compare
  • New methods, for both versions: listenForItemsUpdate(), listenForItemsDeletion();
  • Methods isItemDeleting(), isItemRefreshing(), isItemUpdating(), isItemMutating(), isItemProcessing() now accept Partial<T> as an argument...;
  • ...and implemented in the observable-based version. They return signals there as well to have the same API. To get the same result using observables only, you can use hasItemIn() method.

2.2.1

11 May 15:22
Compare
Choose a tag to compare

Signal-based version (class Collection) now uses NGX_COLLECTION_OPTIONS injection token to inject options, because string injection tokens are deprecated in Angular.

2.2.0

09 May 16:11
Compare
Choose a tag to compare
  • Signal-based Collection!
  • API documentation moved to the interfaces.

2.1.2

05 May 15:33
Compare
Choose a tag to compare
  • toObservable() from '@angular/core/rxjs-interop' will be used without replacement;
  • If instantiated not in an injection context and without injector argument, the constructor() will throw an error in development mode or will print to console.error (or errorReporter, if set), at runtime.

2.1.1

04 May 23:16
Compare
Choose a tag to compare

If class is instantiated in an injection context, the injector will be created from this context.