Skip to content

Commit

Permalink
Update docs for Util.load
Browse files Browse the repository at this point in the history
  • Loading branch information
williamngan committed Oct 11, 2018
1 parent 3424e81 commit 8c48a94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/json/class/Util_Util.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"inherits": false,
"signatures": [
{
"comment": "A helper function to load data from a url via XMLHttpRequest GET. If you're loading json data, use standard `JSON.parse(data)` to parse the data. For csv, try using a javascript csv library like papaparse or vega/datalib.",
"comment": "A helper function to load data from a url via XMLHttpRequest GET. Since the response passed into callback is a string, if you're loading json data, you may use standard `JSON.parse(response)` to get a JSON object. For csv, try using a javascript csv library like papaparse or vega/datalib.",
"returns": "void",
"returns_comment": false,
"parameters": [
Expand All @@ -206,7 +206,7 @@
},
{
"name": "callback",
"comment": "a function to capture the data. It takes two parameters: a `response` as string, and a `success` status as boolean.\n",
"comment": "a function to capture the data. It receives two parameters: a `response` as string, and a `success` status as boolean.\n",
"type": " Fn(response:string, success:boolean)",
"default": false
}
Expand Down
4 changes: 2 additions & 2 deletions src/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ export class Util {


/**
* A helper function to load data from a url via XMLHttpRequest GET. If you're loading json data, use standard `JSON.parse(data)` to parse the data. For csv, try using a javascript csv library like papaparse or vega/datalib.
* A helper function to load data from a url via XMLHttpRequest GET. Since the response passed into callback is a string, if you're loading json data, you may use standard `JSON.parse(response)` to get a JSON object. For csv, try using a javascript csv library like papaparse or vega/datalib.
* @param url the request url
* @param callback a function to capture the data. It takes two parameters: a `response` as string, and a `success` status as boolean.
* @param callback a function to capture the data. It receives two parameters: a `response` as string, and a `success` status as boolean.
*/
static load( url:string, callback:(response:string, success:boolean) => void ) {
var request = new XMLHttpRequest();
Expand Down

0 comments on commit 8c48a94

Please sign in to comment.