-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1984 from genesiscommunitysuccess/mw/PTL-1507-fou…
…ndation-store docs: foundation store written and API docs PTL-1507
- Loading branch information
Showing
78 changed files
with
4,976 additions
and
8 deletions.
There are no files selected for viewing
1,294 changes: 1,294 additions & 0 deletions
1,294
...1_develop/03_client-capabilities/015_layout-management/10_foundation-layout.mdx
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
docs/001_develop/03_client-capabilities/017_state-management/docs/_category_.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
className: 'hidden' |
23 changes: 23 additions & 0 deletions
23
...s/017_state-management/docs/api/foundation-store.abstractstore._constructor_.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [(constructor)](./foundation-store.abstractstore._constructor_.md) | ||
|
||
## AbstractStore.(constructor) | ||
|
||
Constructs a new instance of the `AbstractStore` class | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
constructor(...storeFragments: Store[]); | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| storeFragments | [Store](./foundation-store.store.md)\[\] | The child store fragments this store fragment will manage. | | ||
|
27 changes: 27 additions & 0 deletions
27
...7_state-management/docs/api/foundation-store.abstractstore.addstorefragments.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [addStoreFragments](./foundation-store.abstractstore.addstorefragments.md) | ||
|
||
## AbstractStore.addStoreFragments() method | ||
|
||
Lazily add store fragments. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
addStoreFragments(...storeFragments: Store[]): void; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| storeFragments | [Store](./foundation-store.store.md)\[\] | Store fragments to add. | | ||
|
||
**Returns:** | ||
|
||
void | ||
|
32 changes: 32 additions & 0 deletions
32
...ilities/017_state-management/docs/api/foundation-store.abstractstore.binding.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [binding](./foundation-store.abstractstore.binding.md) | ||
|
||
## AbstractStore.binding() method | ||
|
||
An api to allow the observation of values and arbitrary bindings outside the template engine. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
binding<TReturn = any, TParent = any>(token: ((store: this) => TReturn) | keyof this, subscriberChangeCallback?: SubscriberChangeCallback<TReturn> | undefined, isVolatileBinding?: boolean, context?: ExecutionContext): BindingObserver<this, TReturn, TParent>; | ||
``` | ||
## Parameters | ||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| token | ((store: this) => TReturn) \| keyof this | A store lookup token which can take various forms. | | ||
| subscriberChangeCallback | [SubscriberChangeCallback](./foundation-store.subscriberchangecallback.md)<TReturn> \| undefined | _(Optional)_ [SubscriberChangeCallback](./foundation-store.subscriberchangecallback.md) | | ||
| isVolatileBinding | boolean | _(Optional)_ Indicates the binding is volatile. | | ||
| context | ExecutionContext | _(Optional)_ | | ||
**Returns:** | ||
BindingObserver<this, TReturn, TParent> | ||
An rxjs Observable | ||
19 changes: 19 additions & 0 deletions
19
...ies/017_state-management/docs/api/foundation-store.abstractstore.bindingasrx.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [bindingAsRx](./foundation-store.abstractstore.bindingasrx.md) | ||
|
||
## AbstractStore.bindingAsRx() method | ||
|
||
|
||
**Signature:** | ||
|
||
```typescript | ||
bindingAsRx(): RXObservable<this>; | ||
``` | ||
**Returns:** | ||
|
||
RXObservable<this> | ||
|
26 changes: 26 additions & 0 deletions
26
...s/017_state-management/docs/api/foundation-store.abstractstore.bindingasrx_1.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [bindingAsRx](./foundation-store.abstractstore.bindingasrx_1.md) | ||
|
||
## AbstractStore.bindingAsRx() method | ||
|
||
|
||
**Signature:** | ||
|
||
```typescript | ||
bindingAsRx<TKey extends keyof this>(key: TKey): RXObservable<this[TKey]>; | ||
``` | ||
## Parameters | ||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| key | TKey | | | ||
**Returns:** | ||
RXObservable<this\[TKey\]> | ||
26 changes: 26 additions & 0 deletions
26
...s/017_state-management/docs/api/foundation-store.abstractstore.bindingasrx_2.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [bindingAsRx](./foundation-store.abstractstore.bindingasrx_2.md) | ||
|
||
## AbstractStore.bindingAsRx() method | ||
|
||
|
||
**Signature:** | ||
|
||
```typescript | ||
bindingAsRx<TReturn>(getter: (store: this) => TReturn): RXObservable<TReturn>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| getter | (store: this) => TReturn | | | ||
|
||
**Returns:** | ||
|
||
RXObservable<TReturn> | ||
|
31 changes: 31 additions & 0 deletions
31
...bilities/017_state-management/docs/api/foundation-store.abstractstore.commit.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [commit](./foundation-store.abstractstore.commit.md) | ||
|
||
## AbstractStore.commit property | ||
|
||
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
The value commit proxy. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
protected readonly commit: this; | ||
``` | ||
|
||
## Remarks | ||
|
||
this.commit has the same interface as the store itself, so props are strongly typed. | ||
|
||
## Example | ||
|
||
|
||
```ts | ||
this.commit.propX = value; | ||
``` | ||
|
31 changes: 31 additions & 0 deletions
31
...ies/017_state-management/docs/api/foundation-store.abstractstore.commitvalue.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [commitValue](./foundation-store.abstractstore.commitvalue.md) | ||
|
||
## AbstractStore.commitValue() method | ||
|
||
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
Alternative value commit api. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
protected commitValue<K extends keyof TStore>(key: K, value: TStore[K]): void; | ||
``` | ||
## Parameters | ||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| key | K | The property key from the store's interface. | | ||
| value | TStore\[K\] | The value to set. | | ||
**Returns:** | ||
void | ||
27 changes: 27 additions & 0 deletions
27
...ilities/017_state-management/docs/api/foundation-store.abstractstore.connect.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [connect](./foundation-store.abstractstore.connect.md) | ||
|
||
## AbstractStore.connect() method | ||
|
||
Connects this store fragment. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
connect(root: TStoreRoot): void; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| root | TStoreRoot | The store root fragment. | | ||
|
||
**Returns:** | ||
|
||
void | ||
|
55 changes: 55 additions & 0 deletions
55
...state-management/docs/api/foundation-store.abstractstore.createasynclistener.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [createAsyncListener](./foundation-store.abstractstore.createasynclistener.md) | ||
|
||
## AbstractStore.createAsyncListener property | ||
|
||
Creates an async event listener. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
protected createAsyncListener: <TDetail = void, TReturn = void>(keys: KeyOrKeys<TEventDetailMap & TInternalEventDetailMap>, token: (detail: TDetail, event?: CustomEvent<TDetail>) => Promise<TReturn>) => EventListener; | ||
``` | ||
|
||
## Remarks | ||
|
||
You can think of this like an `effect` in the redux sense. You should not commit values to the store in these, instead raise subsequent events to be handled synchronously, where commits are allowed. | ||
|
||
## Example 1 | ||
|
||
Creating an interface defined handler for a single event key. | ||
|
||
```ts | ||
onDomainAction = this.createAsyncListener<DomainActionDetail>( | ||
'domain-action', | ||
async ({ id, message }) => | ||
this.invokeAsyncAPI( | ||
async () => this.domainService.action(id, message), | ||
'domain-action-error', | ||
'domain-action-success' | ||
) | ||
); | ||
``` | ||
|
||
## Example 2 | ||
|
||
Creating an anonymous handler in the constructor for multiple event keys. | ||
|
||
```ts | ||
this.createAsyncListener( | ||
[ | ||
'columns-changed', | ||
'types-changed', | ||
'max-rows-changed', | ||
'max-view-changed', | ||
'order-by-changed', | ||
'reverse-changed', | ||
], | ||
async (_, { type }) => this.emit('domain-load') | ||
); | ||
``` | ||
|
21 changes: 21 additions & 0 deletions
21
...state-management/docs/api/foundation-store.abstractstore.createerrorlistener.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [createErrorListener](./foundation-store.abstractstore.createerrorlistener.md) | ||
|
||
## AbstractStore.createErrorListener property | ||
|
||
Creates an error event listener. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
protected createErrorListener: <TDetail extends Error = Error>(keys: KeyOrKeys<TEventDetailMap & TInternalEventDetailMap>, token?: (detail: TDetail, event?: CustomEvent<TDetail>) => void) => EventListener; | ||
``` | ||
|
||
## Remarks | ||
|
||
This logs and stores errors by event key in the store fragment's [ErrorMap](./foundation-store.errormap.md), allowing multiple errors to co-exist, and be presentable to the user via the UI for further action or dismissal. | ||
|
21 changes: 21 additions & 0 deletions
21
.../017_state-management/docs/api/foundation-store.abstractstore.createlistener.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [createListener](./foundation-store.abstractstore.createlistener.md) | ||
|
||
## AbstractStore.createListener property | ||
|
||
Creates an event listener. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
protected createListener: <TDetail = void>(keys: KeyOrKeys<TEventDetailMap & TInternalEventDetailMap>, token: (detail: TDetail, event?: CustomEvent<TDetail>) => void) => EventListener; | ||
``` | ||
|
||
## Remarks | ||
|
||
You can think of this like a `reducer` in the redux sense. You are allowed to commit values to the store in these synchronous handlers. | ||
|
27 changes: 27 additions & 0 deletions
27
...ties/017_state-management/docs/api/foundation-store.abstractstore.disconnect.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
format: md | ||
--- | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [disconnect](./foundation-store.abstractstore.disconnect.md) | ||
|
||
## AbstractStore.disconnect() method | ||
|
||
Disconnects this store fragment. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
disconnect(root: TStoreRoot): void; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| root | TStoreRoot | The store root fragment. | | ||
|
||
**Returns:** | ||
|
||
void | ||
|
Oops, something went wrong.