Skip to content

Releases: e-oz/ngx-collection

v1.2.5

27 Nov 19:22
Compare
Choose a tag to compare
  • Make constructors empty (for some reason Angular complains that constructors with arguments are not compatible with dependency injection, although it only happens if code is published to npm).
  • make setOptions() public.

v1.2.1

27 Nov 15:48
Compare
Choose a tag to compare
  • Optimize speed of duplicate detection in read()
  • Add "emitDecoratorMetadata": true to tsconfig

v1.2.0

26 Nov 15:43
Compare
Choose a tag to compare
  • New (additional) methods:
    • createMany()
    • refreshMany()
    • updateMany()
    • deleteMany()
  • request parameter will now accept an array of requests (to forkJoin() them) in:
    • createMany()
    • readMany()
    • refreshMany()
    • updateMany()
    • deleteMany()
      Requests with suffix *many will run in parallel (using forkJoin()). If you need to run them differently, you can use regular methods with the creation operator of your choice.
  • A function can be used as a value for the comparator field in configuration options or as an argument for setComparator() method;
  • New method for override: postInit() - will be called in the next microtask after constructor().
    You can override and use it to call the methods declared in the subclass and still don't bother about constructor() overriding;
  • getTrackByFieldFn() helper will not use fields with empty values;
  • Jest has been configured to run tests in this repo - pull requests are welcome!

v1.1.1

18 Nov 20:59
Compare
Choose a tag to compare

Fixes:

  • readMany() should update totalCountFetched if provided

v1.1.0

18 Nov 17:22
Compare
Choose a tag to compare
  • onDuplicateErrCallbackParam added to configuration options.
  • type restriction for item parameter is relaxed to Partial. It was possible to use partial objects before, but it was not obvious from signatures.
  • New methods readOne(), readMany(), getItem(), getItemByField() have been added and documented.
  • Removed synchronous check from setUniqueStatus() when active = false. It was the only synchronous call in code.

v1.0.10

16 Nov 21:41
Compare
Choose a tag to compare
  • Update dependencies to Angular 15 release version
  • Add file with test to the repo
  • Add deleteItemStatus method

v1.0.9

14 Nov 23:48
Compare
Choose a tag to compare

You can (optionally) declare Collection Service configuration details in your module or component providers:

providers: [
  {
    provide: 'COLLECTION_SERVICE_OPTIONS',
    useValue: {
      allowFetchedDuplicates: environment.production,
    }
  },
]

Token COLLECTION_SERVICE_OPTIONS is just a string to don't break lazy-loading (if you are using it).

Options structure:

interface CollectionServiceOptions {
  comparatorFields?: string[];
  throwOnDuplicates?: string;
  allowFetchedDuplicates?: boolean; // if not set: true
}

v1.0.8

14 Nov 20:13
Compare
Choose a tag to compare
  • Fix itemViewModel.isProcessing;
  • Make all selectors in itemViewModel protected from streams without pre-emitted value;
  • Add getTrackByFieldFn() helper function.