ngx-redux-state-props
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

ngx-redux-state-props

Service that grabs application state and expose on state and state$.

Example

import { Component } from '@angular/core';
import { NgxReduxStatePropsService } from 'ngx-redux-state-props';

import { AppState } from '../app-state.model';
import { AboutActions } from './services/about.actions';

@Component({
  selector: 'app-about',
  templateUrl: './about.component.html',
  styleUrls: ['./about.component.scss'],
})
export class AboutComponent {
  constructor(private actions: AboutActions, private redux: NgxReduxStatePropsService<AppState>) {}

  get state() {
    return this.redux.appState && this.redux.appState.about;
  }

  testRedux() {
    this.actions.getApiValue();
  }

  getNasaApod() {
    this.actions.getNasaApod();
  }
}

Template:

<div>
  <h2>About State</h2>
  <pre>{{ state | json }}</pre>
</div>

/ngx-redux-state-props/

    Package Sidebar

    Install

    npm i ngx-redux-state-props

    Weekly Downloads

    2

    Version

    0.0.8

    License

    none

    Unpacked Size

    78.5 kB

    Total Files

    23

    Last publish

    Collaborators

    • brunolm