@genesislcap/foundation-state-machine 14.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/dist/dts/core/actions.d.ts +61 -0
- package/dist/dts/core/actions.d.ts.map +1 -0
- package/dist/dts/core/binding.d.ts +37 -0
- package/dist/dts/core/binding.d.ts.map +1 -0
- package/dist/dts/core/errors.d.ts +41 -0
- package/dist/dts/core/errors.d.ts.map +1 -0
- package/dist/dts/core/guards.d.ts +67 -0
- package/dist/dts/core/guards.d.ts.map +1 -0
- package/dist/dts/core/index.d.ts +8 -0
- package/dist/dts/core/index.d.ts.map +1 -0
- package/dist/dts/core/inputs.d.ts +19 -0
- package/dist/dts/core/inputs.d.ts.map +1 -0
- package/dist/dts/core/machine.d.ts +338 -0
- package/dist/dts/core/machine.d.ts.map +1 -0
- package/dist/dts/core/state.d.ts +11 -0
- package/dist/dts/core/state.d.ts.map +1 -0
- package/dist/dts/index.d.ts +4 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/index.federated.d.ts +1 -0
- package/dist/dts/index.federated.d.ts.map +1 -0
- package/dist/dts/machines/fetch/errors.d.ts +39 -0
- package/dist/dts/machines/fetch/errors.d.ts.map +1 -0
- package/dist/dts/machines/fetch/index.d.ts +5 -0
- package/dist/dts/machines/fetch/index.d.ts.map +1 -0
- package/dist/dts/machines/fetch/machine.d.ts +57 -0
- package/dist/dts/machines/fetch/machine.d.ts.map +1 -0
- package/dist/dts/machines/fetch/policies.d.ts +25 -0
- package/dist/dts/machines/fetch/policies.d.ts.map +1 -0
- package/dist/dts/machines/fetch/types.d.ts +118 -0
- package/dist/dts/machines/fetch/types.d.ts.map +1 -0
- package/dist/dts/machines/index.d.ts +2 -0
- package/dist/dts/machines/index.d.ts.map +1 -0
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/dts/utils/index.d.ts +2 -0
- package/dist/dts/utils/index.d.ts.map +1 -0
- package/dist/dts/utils/logger.d.ts +5 -0
- package/dist/dts/utils/logger.d.ts.map +1 -0
- package/dist/esm/core/actions.js +46 -0
- package/dist/esm/core/binding.js +16 -0
- package/dist/esm/core/errors.js +70 -0
- package/dist/esm/core/guards.js +73 -0
- package/dist/esm/core/index.js +7 -0
- package/dist/esm/core/inputs.js +10 -0
- package/dist/esm/core/machine.js +180 -0
- package/dist/esm/core/state.js +26 -0
- package/dist/esm/index.federated.js +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/machines/fetch/errors.js +46 -0
- package/dist/esm/machines/fetch/index.js +4 -0
- package/dist/esm/machines/fetch/machine.js +216 -0
- package/dist/esm/machines/fetch/policies.js +48 -0
- package/dist/esm/machines/fetch/types.js +48 -0
- package/dist/esm/machines/index.js +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/logger.js +5 -0
- package/dist/foundation-state-machine.api.json +5594 -0
- package/dist/foundation-state-machine.d.ts +884 -0
- package/docs/.gitattributes +2 -0
- package/docs/api/foundation-state-machine.abstractmachine.actor.md +18 -0
- package/docs/api/foundation-state-machine.abstractmachine.binding.md +27 -0
- package/docs/api/foundation-state-machine.abstractmachine.complete.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.context.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.error.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.errors.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.getfromcontainer.md +23 -0
- package/docs/api/foundation-state-machine.abstractmachine.hastag.md +28 -0
- package/docs/api/foundation-state-machine.abstractmachine.machine.md +18 -0
- package/docs/api/foundation-state-machine.abstractmachine.matches.md +28 -0
- package/docs/api/foundation-state-machine.abstractmachine.md +44 -0
- package/docs/api/foundation-state-machine.abstractmachine.onsendevent.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.output.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.provide.md +24 -0
- package/docs/api/foundation-state-machine.abstractmachine.send.md +24 -0
- package/docs/api/foundation-state-machine.abstractmachine.start.md +28 -0
- package/docs/api/foundation-state-machine.abstractmachine.startingcontext.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.startingstate.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.state.md +13 -0
- package/docs/api/foundation-state-machine.abstractmachine.stop.md +17 -0
- package/docs/api/foundation-state-machine.apierror._constructor_.md +22 -0
- package/docs/api/foundation-state-machine.apierror.data.md +11 -0
- package/docs/api/foundation-state-machine.apierror.md +32 -0
- package/docs/api/foundation-state-machine.apierror.status.md +11 -0
- package/docs/api/foundation-state-machine.assertevent.md +27 -0
- package/docs/api/foundation-state-machine.createerrorstatenode.md +13 -0
- package/docs/api/foundation-state-machine.createfetchpolicy.md +18 -0
- package/docs/api/foundation-state-machine.createresponsedataextractorwithdeserializer.md +13 -0
- package/docs/api/foundation-state-machine.defaultfetchconfig.md +13 -0
- package/docs/api/foundation-state-machine.defaultfetchmachine._constructor_.md +20 -0
- package/docs/api/foundation-state-machine.defaultfetchmachine.getfromcontainer.md +23 -0
- package/docs/api/foundation-state-machine.defaultfetchmachine.md +30 -0
- package/docs/api/foundation-state-machine.defaultfetchmachine.start.md +28 -0
- package/docs/api/foundation-state-machine.defaultfetchmachinecontext.md +13 -0
- package/docs/api/foundation-state-machine.defaultfetchpolicy.md +13 -0
- package/docs/api/foundation-state-machine.defaultresponsedataextractor.md +18 -0
- package/docs/api/foundation-state-machine.defaultresponseokchecker.md +13 -0
- package/docs/api/foundation-state-machine.defaultretrystatscodes.md +13 -0
- package/docs/api/foundation-state-machine.errorworkflowinput.md +15 -0
- package/docs/api/foundation-state-machine.escalateerror.md +42 -0
- package/docs/api/foundation-state-machine.fetchconfig.fetcher.md +13 -0
- package/docs/api/foundation-state-machine.fetchconfig.fetchpolicy.md +13 -0
- package/docs/api/foundation-state-machine.fetchconfig.md +23 -0
- package/docs/api/foundation-state-machine.fetchconfig.responsedataextractor.md +13 -0
- package/docs/api/foundation-state-machine.fetchconfig.responseokchecker.md +13 -0
- package/docs/api/foundation-state-machine.fetchmachine.md +15 -0
- package/docs/api/foundation-state-machine.fetchmachinecontext.controller.md +13 -0
- package/docs/api/foundation-state-machine.fetchmachinecontext.data.md +13 -0
- package/docs/api/foundation-state-machine.fetchmachinecontext.md +28 -0
- package/docs/api/foundation-state-machine.fetchmachinecontext.params.md +17 -0
- package/docs/api/foundation-state-machine.fetchmachinecontext.response.md +13 -0
- package/docs/api/foundation-state-machine.fetchmachineevent.md +24 -0
- package/docs/api/foundation-state-machine.fetchmachineeventmap.md +21 -0
- package/docs/api/foundation-state-machine.fetchmachineoutput.md +21 -0
- package/docs/api/foundation-state-machine.genesisservererror._constructor_.md +22 -0
- package/docs/api/foundation-state-machine.genesisservererror.getdetailserror.md +15 -0
- package/docs/api/foundation-state-machine.genesisservererror.getmessageerror.md +15 -0
- package/docs/api/foundation-state-machine.genesisservererror.haserrorcode.md +22 -0
- package/docs/api/foundation-state-machine.genesisservererror.isignorableerror.md +17 -0
- package/docs/api/foundation-state-machine.genesisservererror.md +41 -0
- package/docs/api/foundation-state-machine.genesisservererror.received.md +11 -0
- package/docs/api/foundation-state-machine.genesisservererror.sent.md +11 -0
- package/docs/api/foundation-state-machine.isaborterror.md +15 -0
- package/docs/api/foundation-state-machine.isactorerrorevent.md +13 -0
- package/docs/api/foundation-state-machine.isapierror.md +11 -0
- package/docs/api/foundation-state-machine.isdoneinvokeevent.md +13 -0
- package/docs/api/foundation-state-machine.iserrorcustomevent.md +18 -0
- package/docs/api/foundation-state-machine.iserrorevent.md +13 -0
- package/docs/api/foundation-state-machine.iserrortype.md +13 -0
- package/docs/api/foundation-state-machine.isgenesisservererror.md +11 -0
- package/docs/api/foundation-state-machine.ismappingerror.md +11 -0
- package/docs/api/foundation-state-machine.isnetworkerror.md +11 -0
- package/docs/api/foundation-state-machine.isnotfounderror.md +13 -0
- package/docs/api/foundation-state-machine.issyntaxerror.md +15 -0
- package/docs/api/foundation-state-machine.istypeerror.md +15 -0
- package/docs/api/foundation-state-machine.logger.md +12 -0
- package/docs/api/foundation-state-machine.machine.actor.md +18 -0
- package/docs/api/foundation-state-machine.machine.binding.md +47 -0
- package/docs/api/foundation-state-machine.machine.complete.md +13 -0
- package/docs/api/foundation-state-machine.machine.context.md +13 -0
- package/docs/api/foundation-state-machine.machine.error.md +13 -0
- package/docs/api/foundation-state-machine.machine.errors.md +13 -0
- package/docs/api/foundation-state-machine.machine.getfromcontainer.md +35 -0
- package/docs/api/foundation-state-machine.machine.hastag.md +35 -0
- package/docs/api/foundation-state-machine.machine.machine.md +18 -0
- package/docs/api/foundation-state-machine.machine.matches.md +35 -0
- package/docs/api/foundation-state-machine.machine.md +101 -0
- package/docs/api/foundation-state-machine.machine.onsendevent.md +24 -0
- package/docs/api/foundation-state-machine.machine.output.md +13 -0
- package/docs/api/foundation-state-machine.machine.provide.md +44 -0
- package/docs/api/foundation-state-machine.machine.send.md +24 -0
- package/docs/api/foundation-state-machine.machine.start.md +28 -0
- package/docs/api/foundation-state-machine.machine.startingcontext.md +13 -0
- package/docs/api/foundation-state-machine.machine.startingstate.md +13 -0
- package/docs/api/foundation-state-machine.machine.state.md +13 -0
- package/docs/api/foundation-state-machine.machine.stop.md +17 -0
- package/docs/api/foundation-state-machine.machinecontext.error.md +13 -0
- package/docs/api/foundation-state-machine.machinecontext.errors.md +13 -0
- package/docs/api/foundation-state-machine.machinecontext.md +36 -0
- package/docs/api/foundation-state-machine.mappingerror._constructor_.md +21 -0
- package/docs/api/foundation-state-machine.mappingerror.dto.md +11 -0
- package/docs/api/foundation-state-machine.mappingerror.md +27 -0
- package/docs/api/foundation-state-machine.md +81 -0
- package/docs/api/foundation-state-machine.networkerror._constructor_.md +21 -0
- package/docs/api/foundation-state-machine.networkerror.md +31 -0
- package/docs/api/foundation-state-machine.networkerror.url.md +11 -0
- package/docs/api/foundation-state-machine.responsedataextractor.md +18 -0
- package/docs/api/foundation-state-machine.responseokchecker.md +13 -0
- package/docs/api/foundation-state-machine.seterror.md +25 -0
- package/docs/api/foundation-state-machine.seterrorbykey.md +25 -0
- package/docs/api/index.md +12 -0
- package/docs/api-report.md +393 -0
- package/license.txt +46 -0
- package/package.json +60 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [actor](./foundation-state-machine.abstractmachine.actor.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.actor property
|
|
6
|
+
|
|
7
|
+
Optional actor
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
actor: InterpreterFrom<StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
Callers can decide to reuse/reference if set or create their own.
|
|
18
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [binding](./foundation-state-machine.abstractmachine.binding.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.binding() method
|
|
6
|
+
|
|
7
|
+
An api to allow the observation of values and arbitrary bindings outside the template engine.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
binding<TReturn = any, TParent = any>(token: ((target: this) => TReturn) | keyof this, subscriberChangeCallback?: SubscriberChangeCallback<TReturn> | undefined, isVolatileBinding?: boolean, context?: ExecutionContext): BindingObserver<this, TReturn, TParent>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| token | ((target: this) => TReturn) \| keyof this | A target lookup token which can take various forms. |
|
|
20
|
+
| subscriberChangeCallback | SubscriberChangeCallback<TReturn> \| undefined | _(Optional)_ . |
|
|
21
|
+
| isVolatileBinding | boolean | _(Optional)_ Indicates the binding is volatile. |
|
|
22
|
+
| context | ExecutionContext | _(Optional)_ . |
|
|
23
|
+
|
|
24
|
+
**Returns:**
|
|
25
|
+
|
|
26
|
+
BindingObserver<this, TReturn, TParent>
|
|
27
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [complete](./foundation-state-machine.abstractmachine.complete.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.complete property
|
|
6
|
+
|
|
7
|
+
Indicates if the machine has completed the happy path.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
complete: boolean;
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [context](./foundation-state-machine.abstractmachine.context.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.context property
|
|
6
|
+
|
|
7
|
+
The current `context` of the machine. The data points in context may be considered transient in nature.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
context: Partial<TContext>;
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [error](./foundation-state-machine.abstractmachine.error.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.error property
|
|
6
|
+
|
|
7
|
+
A general machine error. Likely equal to `errors.lastError`<!-- -->.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
error: any;
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [errors](./foundation-state-machine.abstractmachine.errors.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.errors property
|
|
6
|
+
|
|
7
|
+
An of errors that may have occurred during the machine's workflows.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
errors: ErrorMap<ErrorDetailMap>;
|
|
13
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [getFromContainer](./foundation-state-machine.abstractmachine.getfromcontainer.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.getFromContainer() method
|
|
6
|
+
|
|
7
|
+
Gets the machine from the container.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
abstract getFromContainer(): this;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
this
|
|
17
|
+
|
|
18
|
+
## Remarks
|
|
19
|
+
|
|
20
|
+
Calling `getFromContainer` on an injected machine will return a new instance providing it was registered with the DI as `transient`<!-- -->. This is simply a convenience method, and may be useful as some machines contain 'final' states, meaning once they complete they can no longer receive events. However, if you want to continue to work with your injected machine reference, re-calling [start](./foundation-state-machine.machine.start.md) may also be a viable option.
|
|
21
|
+
|
|
22
|
+
Please note that machines are injected into other machines to form parts of complex workflows. In such cases, the parent machine will `invoke` or `spawn` the injected machine's `logic` directly to always create a new actor.
|
|
23
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [hasTag](./foundation-state-machine.abstractmachine.hastag.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.hasTag() method
|
|
6
|
+
|
|
7
|
+
Check `tags` contain provided tag.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
hasTag(tag: string): boolean;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| tag | string | A tag. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
boolean
|
|
24
|
+
|
|
25
|
+
## Remarks
|
|
26
|
+
|
|
27
|
+
This differs from `matches`<!-- -->, as multiple states may use common tags such as `pending` to indicate some async work is occurring. As with `matches`<!-- -->, `hasTag` can be useful if you need to conditionally run logic or render markup.
|
|
28
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [machine](./foundation-state-machine.abstractmachine.machine.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.machine property
|
|
6
|
+
|
|
7
|
+
Mandatory machine property.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
machine: StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
The logic / config that goes into a machine is not accessible from the outside, and is owned by the implementing class. However, consumers of that may provide custom `implementations` in the xstate sense via the `provide()` api.
|
|
18
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [matches](./foundation-state-machine.abstractmachine.matches.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.matches() method
|
|
6
|
+
|
|
7
|
+
Check `state` matches provided value.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
matches(value: StateValueFrom<typeof this.machine>): boolean;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| value | StateValueFrom<typeof [this.machine](./foundation-state-machine.abstractmachine.machine.md)<!-- -->> | A state value. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
boolean
|
|
24
|
+
|
|
25
|
+
## Remarks
|
|
26
|
+
|
|
27
|
+
Can be useful if you need to conditionally run logic or render markup.
|
|
28
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine class
|
|
6
|
+
|
|
7
|
+
AbstractMachine base class.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare abstract class AbstractMachine<TContext extends MachineContext, TEvent extends EventObject = AnyEventObject, TAction extends ParameterizedObject = ParameterizedObject, TActor extends ProvidedActor = ProvidedActor, TInput = any, TResolvedTypesMeta = ResolveTypegenMeta<TypegenDisabled, NoInfer<TEvent>, TAction, TActor>> implements Machine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>
|
|
13
|
+
```
|
|
14
|
+
**Implements:** [Machine](./foundation-state-machine.machine.md)<!-- --><TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>
|
|
15
|
+
|
|
16
|
+
## Properties
|
|
17
|
+
|
|
18
|
+
| Property | Modifiers | Type | Description |
|
|
19
|
+
| --- | --- | --- | --- |
|
|
20
|
+
| [actor](./foundation-state-machine.abstractmachine.actor.md) | | InterpreterFrom<StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta>> | Optional actor |
|
|
21
|
+
| [complete](./foundation-state-machine.abstractmachine.complete.md) | | boolean | Indicates if the machine has completed the happy path. |
|
|
22
|
+
| [context](./foundation-state-machine.abstractmachine.context.md) | | Partial<TContext> | The current <code>context</code> of the machine. The data points in context may be considered transient in nature. |
|
|
23
|
+
| [error](./foundation-state-machine.abstractmachine.error.md) | | any | A general machine error. Likely equal to <code>errors.lastError</code>. |
|
|
24
|
+
| [errors](./foundation-state-machine.abstractmachine.errors.md) | | ErrorMap<ErrorDetailMap> | An of errors that may have occurred during the machine's workflows. |
|
|
25
|
+
| [machine](./foundation-state-machine.abstractmachine.machine.md) | | StateMachine<TContext, TEvent, TAction, TActor, TInput, TResolvedTypesMeta> | Mandatory machine property. |
|
|
26
|
+
| [onSendEvent](./foundation-state-machine.abstractmachine.onsendevent.md) | | (event: CustomEvent<TEvent>) => void | A custom event handler to send events to the machine. |
|
|
27
|
+
| [output](./foundation-state-machine.abstractmachine.output.md) | | any | Holds successful machine output if any. |
|
|
28
|
+
| [startingContext](./foundation-state-machine.abstractmachine.startingcontext.md) | | Partial<TContext> | The <code>context</code> of the machine when started. |
|
|
29
|
+
| [startingState](./foundation-state-machine.abstractmachine.startingstate.md) | | StateValue | The <code>state</code> of the machine when started. Allows consumers to start a machine from a persisted state. |
|
|
30
|
+
| [state](./foundation-state-machine.abstractmachine.state.md) | | StateValue | The current <code>state</code> of the machine itself. This is not to be confused with state in the data or store sense. |
|
|
31
|
+
|
|
32
|
+
## Methods
|
|
33
|
+
|
|
34
|
+
| Method | Modifiers | Description |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| [binding(token, subscriberChangeCallback, isVolatileBinding, context)](./foundation-state-machine.abstractmachine.binding.md) | | An api to allow the observation of values and arbitrary bindings outside the template engine. |
|
|
37
|
+
| [getFromContainer()](./foundation-state-machine.abstractmachine.getfromcontainer.md) | <code>abstract</code> | Gets the machine from the container. |
|
|
38
|
+
| [hasTag(tag)](./foundation-state-machine.abstractmachine.hastag.md) | | Check <code>tags</code> contain provided tag. |
|
|
39
|
+
| [matches(value)](./foundation-state-machine.abstractmachine.matches.md) | | Check <code>state</code> matches provided value. |
|
|
40
|
+
| [provide(implementations)](./foundation-state-machine.abstractmachine.provide.md) | | Recreate the internal machine with the provided implementations. |
|
|
41
|
+
| [send(event)](./foundation-state-machine.abstractmachine.send.md) | | An api to send events to the machine. |
|
|
42
|
+
| [start(options)](./foundation-state-machine.abstractmachine.start.md) | | Start the machine. |
|
|
43
|
+
| [stop()](./foundation-state-machine.abstractmachine.stop.md) | | Stop the machine. |
|
|
44
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [onSendEvent](./foundation-state-machine.abstractmachine.onsendevent.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.onSendEvent property
|
|
6
|
+
|
|
7
|
+
A custom event handler to send events to the machine.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
onSendEvent: (event: CustomEvent<TEvent>) => void;
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [output](./foundation-state-machine.abstractmachine.output.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.output property
|
|
6
|
+
|
|
7
|
+
Holds successful machine output if any.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
output: any;
|
|
13
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [provide](./foundation-state-machine.abstractmachine.provide.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.provide() method
|
|
6
|
+
|
|
7
|
+
Recreate the internal machine with the provided implementations.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
provide(implementations: InternalMachineImplementations<TContext, TEvent, TAction, TActor, TResolvedTypesMeta, true>): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| implementations | InternalMachineImplementations<TContext, TEvent, TAction, TActor, TResolvedTypesMeta, true> | <code>actions</code>, <code>guards</code>, <code>actors</code>... to merge with existing options. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
void
|
|
24
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [send](./foundation-state-machine.abstractmachine.send.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.send() method
|
|
6
|
+
|
|
7
|
+
An api to send events to the machine.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
send(event: TEvent): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| event | TEvent | An event. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
void
|
|
24
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [start](./foundation-state-machine.abstractmachine.start.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.start() method
|
|
6
|
+
|
|
7
|
+
Start the machine.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
start(options?: InterpreterOptions<typeof this.machine>): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| options | InterpreterOptions<typeof [this.machine](./foundation-state-machine.abstractmachine.machine.md)<!-- -->> | _(Optional)_ Optional InterpreterOptions. Can be used to restore to a previously persisted state. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
void
|
|
24
|
+
|
|
25
|
+
## Remarks
|
|
26
|
+
|
|
27
|
+
Called to ready the machine and create the internal actor (interpreter). This is called internally after `createMachine` by convention, however it should also be called after calling [provide](./foundation-state-machine.machine.provide.md) when overriding logic. Calling `start` on an injected machine allows you to restart/reuse it if needed. This is okay for machines registered as `transient` in the DI, but care should be taken when creating a machine registered as a `singleton`<!-- -->. You may need to check the status of the machine and block re-starts.
|
|
28
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [startingContext](./foundation-state-machine.abstractmachine.startingcontext.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.startingContext property
|
|
6
|
+
|
|
7
|
+
The `context` of the machine when started.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
startingContext: Partial<TContext>;
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [startingState](./foundation-state-machine.abstractmachine.startingstate.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.startingState property
|
|
6
|
+
|
|
7
|
+
The `state` of the machine when started. Allows consumers to start a machine from a persisted state.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
startingState: StateValue;
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [state](./foundation-state-machine.abstractmachine.state.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.state property
|
|
6
|
+
|
|
7
|
+
The current `state` of the machine itself. This is not to be confused with state in the data or store sense.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
state: StateValue;
|
|
13
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [AbstractMachine](./foundation-state-machine.abstractmachine.md) > [stop](./foundation-state-machine.abstractmachine.stop.md)
|
|
4
|
+
|
|
5
|
+
## AbstractMachine.stop() method
|
|
6
|
+
|
|
7
|
+
Stop the machine.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
stop(): void;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
void
|
|
17
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [APIError](./foundation-state-machine.apierror.md) > [(constructor)](./foundation-state-machine.apierror._constructor_.md)
|
|
4
|
+
|
|
5
|
+
## APIError.(constructor)
|
|
6
|
+
|
|
7
|
+
Constructs a new instance of the `APIError` class
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
constructor(status: number, data?: unknown, message?: string);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| status | number | |
|
|
20
|
+
| data | unknown | _(Optional)_ |
|
|
21
|
+
| message | string | _(Optional)_ |
|
|
22
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [APIError](./foundation-state-machine.apierror.md) > [data](./foundation-state-machine.apierror.data.md)
|
|
4
|
+
|
|
5
|
+
## APIError.data property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
data?: unknown;
|
|
11
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [APIError](./foundation-state-machine.apierror.md)
|
|
4
|
+
|
|
5
|
+
## APIError class
|
|
6
|
+
|
|
7
|
+
APIError.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare class APIError extends Error
|
|
13
|
+
```
|
|
14
|
+
**Extends:** Error
|
|
15
|
+
|
|
16
|
+
## Remarks
|
|
17
|
+
|
|
18
|
+
Bad server `Response`<!-- -->.
|
|
19
|
+
|
|
20
|
+
## Constructors
|
|
21
|
+
|
|
22
|
+
| Constructor | Modifiers | Description |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| [(constructor)(status, data, message)](./foundation-state-machine.apierror._constructor_.md) | | Constructs a new instance of the <code>APIError</code> class |
|
|
25
|
+
|
|
26
|
+
## Properties
|
|
27
|
+
|
|
28
|
+
| Property | Modifiers | Type | Description |
|
|
29
|
+
| --- | --- | --- | --- |
|
|
30
|
+
| [data?](./foundation-state-machine.apierror.data.md) | | unknown | _(Optional)_ |
|
|
31
|
+
| [status](./foundation-state-machine.apierror.status.md) | | number | |
|
|
32
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [APIError](./foundation-state-machine.apierror.md) > [status](./foundation-state-machine.apierror.status.md)
|
|
4
|
+
|
|
5
|
+
## APIError.status property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
status: number;
|
|
11
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [assertEvent](./foundation-state-machine.assertevent.md)
|
|
4
|
+
|
|
5
|
+
## assertEvent() function
|
|
6
|
+
|
|
7
|
+
assertEvent.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function assertEvent<TEvent extends EventObject = EventObject>(event: TEvent, type: TEvent['type']): asserts event is Extract<TEvent, {
|
|
13
|
+
type: TEvent['type'];
|
|
14
|
+
}>;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| event | TEvent | An event. |
|
|
22
|
+
| type | TEvent\['type'\] | An event type. |
|
|
23
|
+
|
|
24
|
+
**Returns:**
|
|
25
|
+
|
|
26
|
+
asserts event is Extract<TEvent, { type: TEvent\['type'\]; }>
|
|
27
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [createErrorStateNode](./foundation-state-machine.createerrorstatenode.md)
|
|
4
|
+
|
|
5
|
+
## createErrorStateNode variable
|
|
6
|
+
|
|
7
|
+
Creates an error state node.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
createErrorStateNode: (key: string, metaContent?: string, final?: boolean) => StateNodeConfig<any, any, any, any>
|
|
13
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [createFetchPolicy](./foundation-state-machine.createfetchpolicy.md)
|
|
4
|
+
|
|
5
|
+
## createFetchPolicy variable
|
|
6
|
+
|
|
7
|
+
A fetch policy factory.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
createFetchPolicy: (maxAttempts?: number, retryCodes?: StatusCodes[] | number[], backoff?: IBackoffFactory<IRetryBackoffContext<unknown>>, timeoutDuration?: number, logEvents?: boolean) => import("cockatiel").IMergedPolicy<import("cockatiel").IRetryContext & import("cockatiel").ICancellationContext, never, [import("cockatiel").RetryPolicy, import("cockatiel").TimeoutPolicy]>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
Will retry network errors and responses with certain status codes up to the specified max attempts.
|
|
18
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [createResponseDataExtractorWithDeserializer](./foundation-state-machine.createresponsedataextractorwithdeserializer.md)
|
|
4
|
+
|
|
5
|
+
## createResponseDataExtractorWithDeserializer variable
|
|
6
|
+
|
|
7
|
+
Creates an extractor that applies a deserializer to the extracted response data.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
createResponseDataExtractorWithDeserializer: <TInput = any, TOutput = any>(deserializer: (data: TInput) => Promise<TOutput>, extractor?: ResponseDataExtractor) => ResponseDataExtractor
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [defaultFetchConfig](./foundation-state-machine.defaultfetchconfig.md)
|
|
4
|
+
|
|
5
|
+
## defaultFetchConfig variable
|
|
6
|
+
|
|
7
|
+
The default fetch config.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
defaultFetchConfig: FetchConfig
|
|
13
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [DefaultFetchMachine](./foundation-state-machine.defaultfetchmachine.md) > [(constructor)](./foundation-state-machine.defaultfetchmachine._constructor_.md)
|
|
4
|
+
|
|
5
|
+
## DefaultFetchMachine.(constructor)
|
|
6
|
+
|
|
7
|
+
Constructs a new instance of the `DefaultFetchMachine` class
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
constructor(config?: FetchConfig);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| config | [FetchConfig](./foundation-state-machine.fetchconfig.md) | _(Optional)_ |
|
|
20
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-state-machine](./foundation-state-machine.md) > [DefaultFetchMachine](./foundation-state-machine.defaultfetchmachine.md) > [getFromContainer](./foundation-state-machine.defaultfetchmachine.getfromcontainer.md)
|
|
4
|
+
|
|
5
|
+
## DefaultFetchMachine.getFromContainer() method
|
|
6
|
+
|
|
7
|
+
Gets the machine from the container.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
getFromContainer(): this;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
this
|
|
17
|
+
|
|
18
|
+
## Remarks
|
|
19
|
+
|
|
20
|
+
Calling `getFromContainer` on an injected machine will return a new instance providing it was registered with the DI as `transient`<!-- -->. This is simply a convenience method, and may be useful as some machines contain 'final' states, meaning once they complete they can no longer receive events. However, if you want to continue to work with your injected machine reference, re-calling [start](./foundation-state-machine.machine.start.md) may also be a viable option.
|
|
21
|
+
|
|
22
|
+
Please note that machines are injected into other machines to form parts of complex workflows. In such cases, the parent machine will `invoke` or `spawn` the injected machine's `logic` directly to always create a new actor.
|
|
23
|
+
|