Skip to content

Commit 2ab966f

Browse files
authored
feat(notify): 支持promise调用notice (#3319)
1 parent 48f4973 commit 2ab966f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/packages/notify/notify.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ function getInstance(
3535

3636
function notice(opts: any) {
3737
opts = { ...options, ...opts }
38-
getInstance(opts, (notification: any) => {
39-
messageInstance = notification
38+
return new Promise<void>((resolve) => {
39+
getInstance(opts, (notification: any) => {
40+
messageInstance = notification
41+
resolve()
42+
})
4043
})
4144
}
4245

0 commit comments

Comments
 (0)