Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
node.js には、jquery の event.type メソッドに相当するもの、つまり文字列の形式でイベントの名前を与えるものがありますか?
event.type を試しましたが、これまでのところうまくいきませんでした...
名前を付ける小さなラッパー関数を追加できます
EventEmitter.prototype.addNamedListener = function(event, handler){ return this.addHandler(function(x){ handler({ event: event, data: x }); }); };