Skip to content

Should ToArray() and Each() not provide JQuery objects?  #15

@flimzy

Description

@flimzy

There may be other such instances, but at least the two functions ToArray() and Each() iterate over elements of a jQuery object, exposing each element as another jQuery object in turn. However, the current implementation exposes them as interface{}s, which must then be coerced back into jquery.JQuery objects. Wouldn't it be more natural to just expose these directly? Would this ever be incorrect? Specifically, change the functions to have these signatures:

func (j JQuery) ToArray() []JQuery

func (j JQuery) Each(fn func(int, JQuery)) JQuery

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