Tarjima qoshish uchun havola boyicha o'tib Pull Request oching (havolaga o'tish).
Standart til uchun tarkibni ko'rsatadi.
import { useProvidedScope } from "effector-vue/composition";useProvidedScope introduced in effector-vue 23.3.0
Returns the Scope the component works in, or null when the application runs in global mode. Mostly needed for allSettled and scopeBind calls written by hand: the other composables resolve the scope on their own.
Designed for Vue 3 and Composition API exclusively.
Methods
useProvidedScope(options?)
Formulae
useProvidedScope(options?: { forceScope?: boolean }): Scope | null;useProvidedScope(options: { forceScope: true }): Scope;Arguments
options?{ forceScope?: boolean },forceScopethrows instead of returningnull
Returns
Scope | null, and Scope when forceScope: true is passed.
Examples
Prefetching data on the server
<script setup lang="ts">import { onServerPrefetch } from "vue";import { allSettled } from "effector";import { useProvidedScope, useUnit } from "effector-vue/composition";
import { loadUserFx, $user } from "./model";
const scope = useProvidedScope({ forceScope: true });const user = useUnit($user);
onServerPrefetch(() => allSettled(loadUserFx, { scope, params: 1 }));</script>
<template> <p>{{ user.name }}</p></template>Notes
The scope is resolved through the injection context, so call it in setup before the first await, or inside app.runWithContext. See EffectorScopePlugin for the full resolution order.
Ingliz tilidagi hujjatlar eng dolzarb hisoblanadi, chunki u effector guruhi tomonidan yozilgan va yangilanadi. Hujjatlarni boshqa tillarga tarjima qilish jamiyat tomonidan kuch va istaklar mavjud bo'lganda amalga oshiriladi.
Esda tutingki, tarjima qilingan maqolalar yangilanmasligi mumkin, shuning uchun eng aniq va dolzarb ma'lumot uchun hujjatlarning asl inglizcha versiyasidan foydalanishni tavsiya etamiz.