events icon indicating copy to clipboard operation
events copied to clipboard

Feature request: Return `callback` function on methods.

Open bozdevs opened this issue 7 months ago • 0 comments

Feature request: Return callback function on methods.

If we turn off a listener, it requires type, selector, callback right? In this case, we write same function again and again.

For example:

events.on("click", "document", function(){
   return "Hello!";
});

...

events.off("click", "document", function(){
   return "Hello!";
});

If the on() method give us callback function, we use it again and again.

Example:

callback = events.on("click", "document", function(){
   return "Hello!";
});

...

events.off("click", "document", callback);

In this case, you just add return callback; end of methods.

bozdevs avatar Jul 04 '24 07:07 bozdevs