Skip to content

Commit 01609e0

Browse files
committed
feat: add plugin type
1 parent 770b845 commit 01609e0

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/runtime/hooks/src/loaderPlugin.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import { warn, error, hasOwn } from '@garfish/utils';
33
type Plugin<T extends any> = (result: T) => any;
44

55
export class PluginManager<T> {
6+
public type: string;
7+
public onerror: (errMsg: string | Error) => void = error;
68
private plugins: Set<Plugin<T>> = new Set();
79

8-
type: string;
9-
onerror: (errMsg: string | Error) => void = error;
10-
1110
constructor(type?: string) {
1211
this.type = type;
1312
}

packages/runtime/hooks/src/syncHook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { warn } from '@garfish/utils';
33
type Callback = (...args: Array<any>) => void;
44

55
export class SyncHook {
6-
hooks: Array<{ name: string; fn: Callback }> = [];
6+
public hooks: Array<{ name: string; fn: Callback }> = [];
77

88
on(name: string, fn: Callback) {
99
if (typeof name === 'string' && typeof fn === 'function') {

0 commit comments

Comments
 (0)