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

com.github.nkzawa.socketio.client.On Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
package com.github.nkzawa.socketio.client;

import com.github.nkzawa.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