-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ib Green
committed
Apr 7, 2019
1 parent
a16ba9c
commit 334878f
Showing
66 changed files
with
370 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# load | ||
|
||
The `load` function can be used with any _loader object_. They takes a `url` and one or more _loader objects_, 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. | ||
|
||
### load(url : String | File, loaders : Object | Object[][, options : object]) : Promise<Response> | ||
|
||
### load(url : String | File [, options : Object]) : Promise<Response> | ||
|
||
The `load` function is used to load and parse data with a specific _loader object_. An array of loader objects can be provided, in which case `load` will attempt to autodetect which loader is appropriate for the file. | ||
|
||
The `loaders` parameter can also be ommitted, in which case any _loader objects_ previously registered with [`registerLoaders`](docs/api-reference/core/register-loaders) will be used. | ||
|
||
- `url` - Can be a string, either a data url or a request url, or in Node.js, a file name, or in the browser, a File object. | ||
- `data` - loaded data, either in binary or text format. | ||
- `loaders` - can be a single loader or an array of loaders. If ommitted, will use the list of registered loaders (see `registerLoaders`) | ||
- `options` - optional, contains both options for the read process and options for the loader (see documentation of the specific loader). | ||
- `options.dataType`=`arraybuffer` - By default reads as binary. Set to 'text' to read as text. | ||
|
||
Returns: | ||
|
||
- Return value depends on the _loader object_ category | ||
|
||
Notes: | ||
|
||
- Any path prefix set by `setPathPrefix` will be appended to relative urls. | ||
- `load` takes a `url` and a loader object, checks what type of data that loader prefers to work on (e.g. text, binary, stream, ...), loads the data in the appropriate way, and passes it to the loader. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# save | ||
|
||
> Needs update | ||
`save` and `saveSync` function can be used with any writer. `save` takes a `url` and a writer object, checks what type of data that writer prefers to work on (e.g. text, JSON, binary, stream, ...), saves the data in the appropriate way, and passes it to the writer. | ||
|
||
## Functions | ||
|
||
### save(url : String | File, writer : Object [, options : Object]) : Promise<ArrayBuffer | String> | ||
|
||
The `save` function can be used with any writer. | ||
|
||
`save` takes a `url` and a writer object, checks what type of data that writer prefers to work on (e.g. text, JSON, binary, stream, ...), saves the data in the appropriate way, and passes it to the writer. | ||
|
||
- `url` - Can be a string, either a data url or a request url, or in Node.js, a file name, or in the browser, a File object. | ||
- `data` - saveed data, either in binary or text format. | ||
- `writer` - can be a single writer or an array of writers. | ||
- `options` - optional, contains both options for the read process and options for the writer (see documentation of the specific writer). | ||
- `options.dataType`=`arraybuffer` - By default reads as binary. Set to 'text' to read as text. | ||
|
||
Returns: | ||
|
||
- Return value depends on the category | ||
|
||
Notes: | ||
|
||
- Any path prefix set by `setPathPrefix` will be appended to relative urls. | ||
|
||
### saveSync(url : String [, options : Object]) : ArrayBuffer | String | ||
|
||
Similar to `save` except saves and parses data synchronously. | ||
|
||
Note that for `saveSync` to work, the `url` needs to be saveable synchronously _and_ the writer used must support synchronous parsing. Synchronous saveing only works on data URLs or files in Node.js. In many cases, the asynchronous `save` is more appropriate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.