Skip to content

Commit e88d072

Browse files
authored
Merge pull request #290 from magento-obsessive-owls/MC-19861
MC-19861: Update datastore docs
2 parents 9e20be3 + cd9f1d0 commit e88d072

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/reference/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ For example:
130130

131131
Page Builder stores data for content types in a simple object called the DataStore: `Magento_PageBuilder/js/data-store`.
132132

133-
The name parameter from the [content type configuration](configurations.md) (or storage_key if specified) is the name of a parameter in the DataStore. You can use the subscribe method to listen for changes in the DataStore and perform custom actions like updating the UI.
133+
The `name` parameter from the [content type configuration](configurations.md) (or `storage_key` if specified) is the name of a parameter in the DataStore. You can use the `subscribe` method to listen for changes in the `DataStore` and perform custom actions like updating the UI.
134134

135135
This is how the system binds the data from the DataStore to your elements attribute or style. When you include a new attribute or style, you must specify where it should retrieve its data from the content type. These `name` values normally bind to the field names within UI component forms. The field names are the keys we use to save the data.
136136

docs/reference/data-store.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ dataStore.subscribe(() => {
2626

2727
## API
2828

29-
#### `get(key: string, defaultValue?: any): any`
29+
### `get(key: string, defaultValue?: any): any`
3030

3131
Retrieve a single value from the content type's data store based on its key. You can provide an optional default value if no data is present.
3232

33-
#### `getState(): object`
33+
### `getState(): object`
3434

3535
Get the entire state object for the current content type instance.
3636

37-
#### `set(key: string, value: any): void`
37+
### `set(key: string, value: any): void`
3838

3939
Set a single piece of data into the content type's data store.
4040

41-
#### `setState(): void`
41+
### `setState(): void`
4242

4343
Set the entire state for the current content type.
4444

4545
## Usage
4646

47-
You can use the data store to modify your content type when its data changes. For example, the Page Builder native [Tabs content type](magento2-page-builder/app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/tabs/preview.ts) subscribes to the data store and makes updates to it when a tab-item changes, as show here in TypeScript:
47+
You can use the data store to modify your content type when its data changes. For example, the Page Builder native Tabs content type (magento2-page-builder/app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/tabs/preview.ts) subscribes to the data store and makes updates to it when a tab-item changes, as show here in TypeScript:
4848

4949
```typescript
5050
...

0 commit comments

Comments
 (0)