]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: small update to follow conventions (#1373)
authorSchalk Neethling <schalk.neethling@mechanical-ink.co.za>
Wed, 15 Jun 2022 20:43:59 +0000 (22:43 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Jun 2022 20:43:59 +0000 (22:43 +0200)
On https://pinia.vuejs.org/core-concepts/ it is mentioned that "Naming the returned function use... is a convention across composables to make its usage idiomatic.". In this example though, the returned function is called `todos` as opposed to `useTodos`.

packages/docs/introduction.md

index 4899bee94142c5b7024542021416a7662b097a95..66d9b71913650d1aaebec51d09eafc483c9a8a06 100644 (file)
@@ -123,7 +123,7 @@ Here is a more complete example of the API you will be using with Pinia **with t
 ```js
 import { defineStore } from 'pinia'
 
-export const todos = defineStore('todos', {
+export const useTodos = defineStore('todos', {
   state: () => ({
     /** @type {{ text: string, id: number, isFinished: boolean }[]} */
     todos: [],