Skip to content

iris.one/self.one #167

Open
Open
@surtich

Description

@surtich

I think it would be a good idea that Iris had self.one/iris.one methods that behave similarly to how JQuery one method does.

This would avoid omissions and simplify subscription to events in which we are interested in their first occurrence.

I think it would be easy to do. Something like this:

    iris.one = function(p_eventName, f_func) {
        function f () {
            f_func(arguments);
            iris.off(p_eventName,f);
        }
        iris.on(p_eventName,f);
    };

Perhaps the tricky part is to reimplement the iris.off method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions