Skip to content

Remove ArrayLike from ObservableInput #6011

Closed
@benlesh

Description

@benlesh

Related to this issue here: #4563

The problem is that this is true:

const x: ArrayLike<any> = () => {}

But at runtime, our check makes sure it's not a function:

export const isArrayLike = (<T>(x: any): x is ArrayLike<T> => 
    x && typeof x.length === 'number' && typeof x !== 'function');

This, combined with the fact that any "array-like" I know of has implemented Symbol.iterator now, means that this type is mostly worthless. I doubt many people are like:

const source$ = from({
   length: 2,
   "0": "wee",
   "1": "I'm weird!"
})

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