angular - Issue in implementing the Ngrx Store service into my component -


after user tried issue regarding post: my stackoverflow old post trying implement ngrx store using ngrx store github me solve multiples input/output event.

just after constructor have error:

counter not assignable parameter of type (state: appstate) => boolean:

child.ts:

import { component, input, output, eventemitter } '@angular/core'; import { userservice3 } '../user3.service'; import { store } '@ngrx/store'; import { observable } 'rxjs/observable'; import { on, off, reset } '../counter';  interface appstate {   counter: boolean; }  @component({   selector: 'my-daydetail',   templateurl: './my-daydetail.component.html',   styleurls: ['./my-daydetail.component.css'] }) export class mydaydetailcomponent  {    counter: observable<boolean>;    constructor(private store: store<appstate>) {     this.counter = store.select('counter');   }    //... }  // counter.ts  import { action } '@ngrx/store';  export const on = 'on'; export const off = 'off'; export const reset = 'reset';  export function counterreducer(state: boolean = true, action: action) {   switch (action.type) {   case on:     return false;    case off:     return true;    case reset:     return 0;    default:     return state; } 

}


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -