by tanepiper · 6y ago · 0 comments
One thing is I can't really find docs - I want to add RxJS on the page - is this possible?
Edit: Oh nevermind, I see it in the screenshot on the Github page with the import
Edit 2: Oh actually it's not working:
TypeError: Cannot set property 'rxjs' of undefined
If I try import { interval } from '...' I get: SyntaxError: 'import' and 'export' may only appear at the top level (1:14)E.G. const foo = await import('foo.js');
It looks like the reason it doesn't work here is because it relies on "this" being the window object. To make top-level await possible your code gets wrapped into a function, and in there "this" no longer points to the window. I am sure a workaround is possible, I'll make a ticket on github.