Skip to content

Commit

Permalink
fix(core): 修复 invokeHook 参数 hookName 的类型报错 (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
BboyZaki authored Jul 13, 2023
1 parent aa712eb commit 3e1cfcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/utils/invokeHook.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getSharedProperty, logger, MorHooks } from '@morjs/api'
import { getSharedProperty, logger, MorHookNames } from '@morjs/api'

/**
* 调用 hook
* @param hookName hook 名字
*/
export const invokeHook = function (hookName: keyof MorHooks) {
export const invokeHook = function (hookName: MorHookNames) {
return function (this: Record<string, any>, ...args: any[]): void {
const hook = getSharedProperty('$morHooks', this)?.[hookName]
if (typeof hook?.call === 'function') {
Expand Down

0 comments on commit 3e1cfcb

Please sign in to comment.