Skip to content

listen method doesn't work inside a web worker #17

@W4G1

Description

@W4G1

Try to run this snipped inside a web worker:

let obj = icaro({})

obj.listen(function () {
  console.log('Something changed!')
})

obj.foo = 'bar'

It will result in this error and the listener function never gets triggered:

TypeError: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': No function was found that matched the signature provided.
    at registerImmediate (set-immediate.js?f31a:66)
    at setImmediate (set-immediate.js?f31a:15)
    at Object.eval (index.js?74c6:112)
    at Object.set (index.js?74c6:75)

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