Class StatefulService<TState>

helps to integrate services with Vuex store

Type parameters

  • TState: any

Hierarchy

Index

Constructors

constructor

Properties

serviceName

serviceName: string = this.constructor.name

Static hasInstance

hasInstance: boolean = false

Static isSingleton

isSingleton: boolean = true

Static serviceAfterInit

serviceAfterInit: Subject<Service> = new Subject<Service>()

lifecycle hook

Accessors

state

  • get state(): TState
  • set state(newState: TState): void

store

  • get store(): Store<any>

Static instance

  • get instance(): any

Methods

Protected afterInit

  • afterInit(): void
  • calls only once per application life all observers are ready to listen service's events

    Returns void

Protected init

  • init(): void

Protected mounted

  • mounted(): void

Static createInstance

  • createInstance(ServiceClass: any): any

Static getResourceId

  • getResourceId(resource: any): string

Static getStore

  • getStore(): Store<any>

Static setupInitFunction

  • setupInitFunction(fn: function): void

Static setupProxy

  • setupProxy(fn: function): void

Static setupVuexStore

  • setupVuexStore(store: Store<any>): void