1.0.4 • Published 7 years ago

ractor-angular v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

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)
  }
1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago