@@ -1645,16 +1645,18 @@ JSROOT.define(['rawinflate'], () => {
16451645 * @param {binary } sinfo_rawdata - data of streamer info root.bin request
16461646 * @returns {object } - created JavaScript object
16471647 * @example
1648- * JSROOT.httpRequest("http://localhost:8080/Files/job1.root/hpx/root.bin", "buf")
1649- * .then(obj_data => JSROOT.httpRequest("http://localhost:8080/StreamerInfo/root.bin", "buf")
1650- * .then(si_data => JSROOT.reconstructObject("TH1F", obj_data, si_data)))
1651- * .then(histo => console.log(`Get histogram with title = ${histo.fTitle}`))
1652- * .catch(err => console.error(err));
1648+ * async function read_binary_and_draw() {
1649+ * await JSROOT.require("io");
1650+ * let obj_data = await JSROOT.httpRequest("http://localhost:8080/Files/job1.root/hpx/root.bin", "buf");
1651+ * let si_data = await JSROOT.httpRequest("http://localhost:8080/StreamerInfo/root.bin", "buf");
1652+ * let histo = await JSROOT.reconstructObject("TH1F", obj_data, si_data);
1653+ * console.log(`Get histogram with title = ${histo.fTitle}`);
1654+ * }
1655+ * read_binary_and_draw();
16531656 *
1654- * // same data via root.json request
1657+ * // request same data via root.json request
16551658 * JSROOT.httpRequest("http://localhost:8080/Files/job1.root/hpx/root.json", "object")
1656- * .then(histo => console.log(`Get histogram with title = ${histo.fTitle}`))
1657- * .catch(err => console.error(err.message)); */
1659+ * .then(histo => console.log(`Get histogram with title = ${histo.fTitle}`)); */
16581660 JSROOT . reconstructObject = function ( class_name , obj_rawdata , sinfo_rawdata ) {
16591661
16601662 let file = new TFile ;
@@ -3083,11 +3085,10 @@ JSROOT.define(['rawinflate'], () => {
30833085 * - [File]{@link https://developer.mozilla.org/en-US/docs/Web/API/File} instance which let read local files from browser
30843086 * - [ArrayBuffer]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer} instance with complete file content
30853087 * @param {string|object } arg - argument for file open like url, see details
3086- * @returns {object } - Promise with TFile instance when file is opened
3088+ * @returns {object } - Promise with { @link JSROOT. TFile} instance when file is opened
30873089 * @example
30883090 * JSROOT.openFile("https://root.cern/js/files/hsimple.root")
30893091 * .then(f => console.log(`Open file ${f.getFileName()}`)); */
3090-
30913092 JSROOT . openFile = function ( arg ) {
30923093
30933094 let file ;
0 commit comments