Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

v1.0.0-rc2 doesn't work on Webworker #614

Closed
2knu opened this issue Jun 24, 2020 · 1 comment
Closed

v1.0.0-rc2 doesn't work on Webworker #614

2knu opened this issue Jun 24, 2020 · 1 comment
Assignees

Comments

@2knu
Copy link
Contributor

2knu commented Jun 24, 2020

I'm using re-frame in webworker (primary to use pneumatic-tubes for dispatching events from serverside over an websocket to webworker). With the newest v1.0.0-rc2 of re-frame it doesn't work anymore, with v0.12.0 it worked.

Error message

Uncaught ReferenceError: window is not defined
   at re_frame$interop$on_load (interop.cljs:9)
   at settings.cljc:13

Possible Fix

Using js/self instead of js/window (in interop.cljs) would fix this issue (tested in webworker and main thread). In main thread it gives the window object, in webworker it gives the worker object.

(defn on-load
     [listener]
     (events/listen js/self "load" listener))
@superstructor
Copy link
Contributor

Should be fixed by #615

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants