Skip to content

Symbol.observable is undefined #214

@brucemcpherson

Description

@brucemcpherson

Using Node v20.11.1

This function in distribution/index.js

export function isObservable(value) {
    if (!value) {
        return false;
    }
    // eslint-disable-next-line no-use-extend-native/no-use-extend-native, @typescript-eslint/no-unsafe-call
    if (value === value[Symbol.observable]?.()) {
        return true;
    }
    // eslint-disable-next-line @typescript-eslint/no-unsafe-call
    if (value === value['@@observable']?.()) {
        return true;
    }
    return false;
}

Cause objects being tested - for example is(myObject) - to try to fetch an 'undefined' property from myObject, as Symbol.observable is undefined

This causes a problem when testing an object which is a proxy with property validity checking built in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions