Store
createReceive(): Receive
We can use the helper function to create ReceiveBuilder
which have two convenient function to catch message.
public createReceive() {
return this.receiveBuilder().match(Greeting, greeting => console.log(greeting.message)).build()
}
preStart()
called after store have mounted to system.
postStop()
called after store have unmounted from system.
postError()
called when error raised in Receive
which create by createReceive
public createReceive() {
return this.receiveBuilder().match(Greeting, greeting => {throw Error("some error")}).build()
}
public postError(err: Error) {
// true
err.message === "some error"
}