@storyblok/nuxt 5.0.1 → 5.0.2
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.
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default useAsyncStoryblok;
|
|
2
|
+
declare function useAsyncStoryblok(url: any, apiOptions?: {}, bridgeOptions?: {}): Promise<any>;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { useStoryblokApi, useStoryblokBridge } from "@storyblok/vue";
|
|
2
2
|
import { useAsyncData, useState, onMounted } from "#imports";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
url,
|
|
6
|
-
apiOptions = {},
|
|
7
|
-
bridgeOptions = {}
|
|
8
|
-
) => {
|
|
4
|
+
const useAsyncStoryblok = async (url, apiOptions = {}, bridgeOptions = {}) => {
|
|
9
5
|
const uniqueKey = `${JSON.stringify(apiOptions)}${url}`;
|
|
10
6
|
const story = useState(`${uniqueKey}-state`, () => null);
|
|
11
7
|
const storyblokApiInstance = useStoryblokApi();
|
|
@@ -28,3 +24,5 @@ export const useAsyncStoryblok = async (
|
|
|
28
24
|
|
|
29
25
|
return story;
|
|
30
26
|
};
|
|
27
|
+
|
|
28
|
+
export default useAsyncStoryblok;
|