mscststs-EventBus

自用,eventbus库

Ten skrypt nie powinien być instalowany bezpośrednio. Jest to biblioteka dla innych skyptów do włączenia dyrektywą meta // @require https://update.greasyfork.org/scripts/373588/639557/mscststs-EventBus.js

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

Autor
mscststs
Wersja
0.0.1.20181024134253
Utworzono
24-10-2018
Zaktualizowano
24-10-2018
Rozmiar
1,44 KB
Licencja
Brak licencji

一个自用的 eventbus

    以事件监听方式进行 部署,所有功能均需运行在eve接口之上。
    eve接口暴露了三个方法,使用on方法可以绑定一个事件和回调函数,index参数用于确认回调函数的优先级,index越大,越优先,相同的以先绑定的优先
    使用off方法可以解绑一个事件,如果绑定时使用了index,则解绑时也需要使用index,否则无法匹配
    使用emit可以触发一个事件,在回调函数中返回false将会阻止 index 较小的参数的继续回调

    例如:回调函数a和b同时绑定了“foo”,事件,a index为10,b index 为11,若b返回false,则 a 不会被回调