mirror of
https://github.com/visgl/luma.gl.git
synced 2025-12-08 17:36:19 +00:00
21 lines
503 B
Markdown
21 lines
503 B
Markdown
# loadFile
|
|
|
|
The `loadFile` function can be used with any loader. It takes a `url` and a loader object, checks what type of data that loader prefers to work on (e.g. text, JSON, binary, stream, ...), loads the data in the appropriate way, and passes it to the loader.
|
|
|
|
|
|
## Usage
|
|
|
|
```
|
|
import {OBJLoader, loadFile} from 'loaders.gl';
|
|
|
|
loadFile(url, OBJLoader).then(data => {
|
|
// Application code here
|
|
...
|
|
});
|
|
```
|
|
|
|
## Function
|
|
|
|
### loadFile(url : String, loader : Object [, options : Object]) : Promise
|
|
|