Skip to content

Commit 0ab1923

Browse files
committed
chore(createPlugin): add @example to docblock
1 parent 8d35443 commit 0ab1923

File tree

1 file changed

+16
-0
lines changed
  • packages/0/src/composables/createPlugin

1 file changed

+16
-0
lines changed

packages/0/src/composables/createPlugin/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@ export interface Plugin {
1919
*
2020
* @see https://vuejs.org/guide/reusability/plugins.html
2121
* @see https://0.vuetifyjs.com/composables/foundation/create-plugin
22+
*
23+
* @example
24+
* ```ts
25+
* export const [useContext, provideContext] = createContext<MyContext>('my-plugin')
26+
*
27+
* const context = {}
28+
*
29+
* export const MyPlugin = createPlugin({
30+
* namespace: 'my-plugin',
31+
* provide: (app) => {
32+
* provideContext(context, app)
33+
* },
34+
* setup: (app) => {
35+
* // Optional setup logic
36+
* },
37+
* })
2238
*/
2339
export function createPlugin<Z extends Plugin = Plugin> (options: PluginOptions) {
2440
return {

0 commit comments

Comments
 (0)