Skip to content

1.2.1 Channel support for "self-deleting" listeners (once)

Latest

Choose a tag to compare

@Guthib-of-Dan Guthib-of-Dan released this 19 Mar 22:56
· 2 commits to main since this release

Now Channel has an ability to remove elements from itself, simulating "once" behaviour.

var channel = new Channel();
function selfDelete() { channel.unsubCurrent(); }
channel.sub(selfDelete);
channel.pub(undefined)
// here selfDelete is no longer registered