Angular
Install
npm install overmind overmind-angularConfigure
import { IConfig } from 'overmind'
import { Injectable } from '@angular/core'
import { OvermindService } from 'overmind-angular'
import { state } from './state'
import * as actions from './actions'
export const config = { state, actions }
declare module 'overmind' {
interface Config extends IConfig<typeof config> {}
}
@Injectable({
providedIn: 'root'
})
export class Store extends OvermindService<typeof config> {}import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { createOvermind } from 'overmind';
import { OvermindModule, OvermindService, OVERMIND_INSTANCE } from 'overmind-angular'
import { config, Store } from './overmind'
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule, OvermindModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ],
providers: [
{ provide: OVERMIND_INSTANCE, useFactory: () => createOvermind(config) },
{ provide: Store, useExisting: OvermindService }
]
})
export class AppModule { }
Polyfill environment
NgZone
Rendering
Passing state as input
Reactions
Last updated