ractor-angular
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

ractor-angular

安装

npm i ractor-angular

配置

@NgModule({
  imports: [
    BrowserModule,
    StoreModule.provideStore(AppStore)
  ],
  declarations: [
    AppComponent
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

使用

export class AppComponent implements OnInit, OnDestroy {
  public value: number
  public unsubscribe: () => void
 
  constructor(public appStore: AppStore) { }
 
  public ngOnInit() {
    this.unsubscribe = this.appStore.subscribe(state => {
      this.value = state.value
    })
  }
 
  public ngOnDestroy() {
    this.unsubscribe()
  }
 
  public increment() {
    dispatch(new Increment)
  }
 
  public decrement() {
    dispatch(new Decrement)
  }

Readme

Keywords

Package Sidebar

Install

npm i ractor-angular

Weekly Downloads

0

Version

1.0.4

License

ISC

Last publish

Collaborators

  • xaomon