Skip to content

Commit f10ba28

Browse files
committed
chore(createPlugin): update doc block
1 parent e0ab103 commit f10ba28

File tree

1 file changed

+5
-6
lines changed
  • packages/0/src/factories/createPlugin

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import type { App } from 'vue'
44
export interface PluginOptions {
55
namespace: string
66
provide: (app: App) => void
7-
setup?: (app: App) => void | Promise<void>
7+
setup?: (app: App) => void
88
}
99

1010
/**
11-
* A universal plugin factory to reduce boilerplate code for Vue plugin creation.
12-
* @param options Configurable object with namespace and provide/setup methods.
13-
* @returns A Vue plugin object with install method that runs app w/ context.
11+
* A universal plugin factory to reduce boilerplate code for Vue plugin creation
12+
* @param options Configurable object with namespace and provide/setup methods
13+
* @returns A Vue plugin object with install method that runs app w/ context
1414
*
1515
* @see https://vuejs.org/api/application.html#app-runwithcontext
1616
* @see https://0.vuetifyjs.com/factories/create-plugin
@@ -20,8 +20,7 @@ export function createPlugin<Z> (options: PluginOptions) {
2020
install (app: App) {
2121
app.runWithContext(() => {
2222
options.provide(app)
23-
24-
if (options.setup) options.setup(app)
23+
options.setup?.(app)
2524
})
2625
},
2726
} as Z

0 commit comments

Comments
 (0)