Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

ngx-redux-state-props

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>

Keywords

none

Install

npm i ngx-redux-state-props

DownloadsWeekly Downloads

0

Version

0.0.8

License

none

Unpacked Size

78.5 kB

Total Files

23

Last publish

Collaborators

  • avatar