Reference · The <wakusei-body> element
setThreeLoaderfunction
Where three.js comes from, if a page wants to hand it over itself (before the first element connects). A page that hands over a module that re-exports only the parts the bodies use ships a few hundred kilobytes of three.js instead of all of it, and a page with no bundler gives the address of a module (an import map is the other way).
Import it
import { setThreeLoader } from "@johnmorrisdotca/wakusei-planets/element";
Also exported from: @johnmorrisdotca/wakusei-planets/portrait, @johnmorrisdotca/wakusei-planets/space/element
Definition
function setThreeLoader(load: () => Promise<ThreeParts>): void
Parameters
| Name | Type | Description |
|---|---|---|
load | () => Promise<ThreeParts> | Returns the three.js module, as a promise. |
Examples
import { setThreeLoader } from "@johnmorrisdotca/wakusei-planets/element";
setThreeLoader(() => import("three"));