0.0.0-765c805f79be5319519cd0d0f33662f6c138532f • Published 5 years ago

@classi/ngrx-extensions v0.0.0-765c805f79be5319519cd0d0f33662f6c138532f

Weekly downloads
72
License
-
Repository
-
Last release
5 years ago

ngrx-extensions

A set of utilities for NgRx family.

Features

  • @ngrx/store
    • createFeatureStoreSelector()

Install

yarn add @classi/ngrx-extensions

APIs

store createFeatureStoreSelector()

See details in counter-store.ts

// counter-store.ts
export default function reducer(state: State, action: typeof actionsUnion) {
  return _reducer(state, action);
}

export const featureName = 'counter';
export const select = createFeatureStoreSelector<State>(featureName);
import { Store } from '@ngrx/store';
import * as counterStore from './counter-store';

@Component({})
export class SomeComponent {
  constructor(private readonly store: Store<{}>) {}

  // Retrieve a scoped state from the feature store
  readonly count$ = counterStore.select(this.store, (state) => state.count);
}
3.0.0-next.1

4 years ago

3.0.0

4 years ago

2.0.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago