-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(composables): sharedRef with default value (#1591)
- Loading branch information
Showing
5 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
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
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
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,30 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@shopware-pwa/composables](./composables.md) > [useSharedState](./composables.usesharedstate.md) | ||
|
||
## useSharedState() function | ||
|
||
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. | ||
> | ||
Replacement for Vuex. Composable, which enables you to use shared state in your application. State is shared both on server and client side. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function useSharedState(rootContext: ApplicationVueContext): { | ||
sharedRef: <T>(uniqueKey: string, defaultValue?: T | undefined) => WritableComputedRef<T | null>; | ||
preloadRef: (refObject: Ref<unknown>, callback: () => Promise<void>) => Promise<void>; | ||
}; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| rootContext | [ApplicationVueContext](./composables.applicationvuecontext.md) | | | ||
|
||
<b>Returns:</b> | ||
|
||
{ sharedRef: <T>(uniqueKey: string, defaultValue?: T \| undefined) => WritableComputedRef<T \| null>; preloadRef: (refObject: Ref<unknown>, callback: () => Promise<void>) => Promise<void>; } | ||
|
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
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
cea3b15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: