-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
100 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,49 @@ | ||
package events | ||
|
||
// 注册操作 | ||
// Add Action | ||
func AddAction(event any, listener any, sort int) { | ||
Default.Action().Listen(event, listener, sort) | ||
} | ||
|
||
// 触发操作 | ||
// Do Action | ||
func DoAction(event any, params ...any) { | ||
Default.Action().Trigger(event, params...) | ||
} | ||
|
||
// 移除操作 | ||
// Remove Action | ||
func RemoveAction(event string, listener any, sort int) bool { | ||
return Default.Action().RemoveListener(event, listener, sort) | ||
} | ||
|
||
// 是否有操作 | ||
// Has Action | ||
func HasAction(event string, listener any) bool { | ||
return Default.Action().HasListener(event, listener) | ||
} | ||
|
||
// 注册过滤器 | ||
// Add Filter | ||
func AddFilter(event any, listener any, sort int) { | ||
Default.Filter().Listen(event, listener, sort) | ||
} | ||
|
||
// 触发过滤器 | ||
// Apply Filters | ||
func ApplyFilters(event any, params ...any) any { | ||
return Default.Filter().Trigger(event, params...) | ||
} | ||
|
||
// 移除过滤器 | ||
// Remove Filter | ||
func RemoveFilter(event string, listener any, sort int) bool { | ||
return Default.Filter().RemoveListener(event, listener, sort) | ||
} | ||
|
||
// 是否有过滤器 | ||
// Has Filter | ||
func HasFilter(event string, listener any) bool { | ||
return Default.Filter().HasListener(event, listener) | ||
} |