Skip to content

Instantly share code, notes, and snippets.

@bfgeek
Created April 5, 2017 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bfgeek/5295003fe0cbeb8f57d9c52009c4f3f0 to your computer and use it in GitHub Desktop.
Save bfgeek/5295003fe0cbeb8f57d9c52009c4f3f0 to your computer and use it in GitHub Desktop.
<script worklet="paint" src="paint.js"></script>
<!--
This makes the script a type="module" and has similar loading behaviour, e.g.
if async is present it will not wait until the whole document is parsed to begin
executing, if not - it waits until the whole document is parsed to being executing
on worklets.
-->
<script worklet="paint">
import F from 'f.js';
registerPaint('foo', class extends F {
// etc.
});
</script>
<!-- inside definitions are now also possible! -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment