useSelectors

The big brother of useSelect isbindSelectors.. It works similar, but useSelectors allows you to bind a group of selectors that become transformed to Observables at runtime.

If you add more and more selectors and they are bound to the facade already, the selectors automatically are available in you component without touching the facade again (see component.ts).

import { useSelectors, StoreChunk } from '@ngrx-ducks/core';

import * as selectors from './selectors';

@StoreChunk()
export class Chunk {
  select = useSelectors(selectors);
}

Last updated