Reference · The <chikyu-earth-realistic> 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 re-exporting only the parts the Earth and the space view use ships a few hundred kilobytes of three.js instead of all of it.
Import it
import { setThreeLoader } from "@johnmorrisdotca/chikyu-earth/realistic/element";
Also exported from: @johnmorrisdotca/chikyu-earth/space/element
Definition
function setThreeLoader(load: () => Promise<Three>): void
Parameters
| Name | Type | Description |
|---|---|---|
load | () => Promise<Three> | Returns the parts of three.js the Earth and the space view use, as a promise. |
Examples
import { setThreeLoader } from "@johnmorrisdotca/chikyu-earth/realistic/element";
setThreeLoader(() => import("three"));