Type Alias: Capability<TMachine, TAdded>
API / @xmachines/play-xstate / index / Capability
type Capability<TMachine, TAdded> = (Base) => PlayerConstructor<TMachine, TAdded>;Defined in: packages/play-xstate/src/capabilities.ts:69
One capability of an actor: a function that takes an actor class and answers the same
class with TAdded on the instance.
withRouting of @xmachines/play-xstate/routing and withView of
@xmachines/play-xstate/view are the two that this package ships. Write your own with
the same shape, and compose takes it beside them.
Type Parameters
| Type Parameter | Description |
|---|---|
TMachine extends AnyStateMachine | The machine of the actor. |
TAdded extends object | What the capability adds to the instance, for example Routable. |
Parameters
| Parameter | Type |
|---|---|
Base | PlayerConstructor<TMachine> |
Returns
PlayerConstructor<TMachine, TAdded>