All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.socket.client.On Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
package io.socket.client;

import io.socket.emitter.Emitter;

public class On {

    private On() {}

    public static Handle on(final Emitter obj, final String ev, final Emitter.Listener fn) {
        obj.on(ev, fn);
        return new Handle() {
            @Override
            public void destroy() {
                obj.off(ev, fn);
            }
        };
    }

    public static interface Handle {

        public void destroy();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy