A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://effector.dev/en/api/effector-vue/useStore below:

Website Navigation


useStore | effector

import { useStore } from "effector-vue/composition";

A hook function, which subscribes to watcher, that observes changes in the current readonly store, so when recording results, the component will update automatically. You can mutate the store value only via createEvent. Designed for vue 3

useStore($store) Arguments
  1. $store (Store<State>)
Returns

(readonly(State))

Example

import { createStore, createApi } from "effector";

import { useStore } from "effector-vue/composition";

const $counter = createStore(0);

const { incremented, decremented } = createApi($counter, {

incremented: (count) => count + 1,

decremented: (count) => count - 1,

});

export default {

setup() {

const counter = useStore($counter);

return {

counter,

incremented,

decremented,

};

},

};

More

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4