Skip to content

Commit

Permalink
docs: update links to vue docs (#2522)
Browse files Browse the repository at this point in the history
* docs: update link to the docs of methods of vue

* docs: update link to the docs of reactive of vue
  • Loading branch information
nazarepiedady authored Dec 14, 2023
1 parent fece1f2 commit 0789f6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/docs/core-concepts/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
title="Learn all about actions in Pinia"
/>

Actions are the equivalent of [methods](https://v3.vuejs.org/guide/data-methods.html#methods) in components. They can be defined with the `actions` property in `defineStore()` and **they are perfect to define business logic**:
Actions are the equivalent of [methods](https://vuejs.org/api/options-state.html#methods) in components. They can be defined with the `actions` property in `defineStore()` and **they are perfect to define business logic**:

```js
export const useCounterStore = defineStore('counter', {
Expand Down Expand Up @@ -166,7 +166,7 @@ export default {

## Subscribing to actions

It is possible to observe actions and their outcome with `store.$onAction()`. The callback passed to it is executed before the action itself. `after` handles promises and allows you to execute a function after the action resolves. In a similar way, `onError` allows you to execute a function if the action throws or rejects. These are useful for tracking errors at runtime, similar to [this tip in the Vue docs](https://v3.vuejs.org/guide/tooling/deployment.html#tracking-runtime-errors).
It is possible to observe actions and their outcome with `store.$onAction()`. The callback passed to it is executed before the action itself. `after` handles promises and allows you to execute a function after the action resolves. In a similar way, `onError` allows you to execute a function if the action throws or rejects. These are useful for tracking errors at runtime, similar to [this tip in the Vue docs](https://vuejs.org/guide/best-practices/production-deployment#tracking-runtime-errors).

Here is an example that logs before running actions and after they resolve/reject.

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/core-concepts/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pinia.use(({ store }) => {
})
```

Note that every store is wrapped with [`reactive`](https://v3.vuejs.org/api/basic-reactivity.html#reactive), automatically unwrapping any Ref (`ref()`, `computed()`, ...) it contains:
Note that every store is wrapped with [`reactive`](https://vuejs.org/api/reactivity-core#reactive), automatically unwrapping any Ref (`ref()`, `computed()`, ...) it contains:

```js
const sharedRef = ref('shared')
Expand Down

0 comments on commit 0789f6f

Please sign in to comment.