Skip to content

Commit a333094

Browse files
committed
Hyperdata
1 parent b40e6a5 commit a333094

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

bundle/examples/simple/client.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"The number id **{{ info.num }}** and the number again {{ info.txt }} and {{ info.txt.ttt.hello.opa }}"
99
],
1010
"main": [
11-
"The number id **{{ [/examples/simple/source.html] info.num }}** and **{{ [/examples/simple/source.html] info.txt }}**",
11+
"The external number id **{{ [/examples/simple/source.html] info.num }}** and **{{ [/examples/simple/source.html] info.txt }}**",
1212
"The number id **{{ info.num }}** and the number again {{ info.txt }}",
1313
"The number id **{{ [/examples/simple/source.html] info.nested.hello }}**",
1414
"WDR Title **{{ [https://webdatarender.com] #title }}**",

bundle/examples/simple/source.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,20 @@
55
"txt": "Universe",
66
"nested": {
77
"hello": "world"
8-
}
8+
},
9+
"description": [
10+
"#1 This is one text.",
11+
"#2 This is another text.",
12+
"#3 Paragraph 3."
13+
],
14+
"test": "console.log('Hi')"
915
},
1016
"main": [
11-
"The number id **{{ info.num }}** and the number again {{ info.txt }} in {{ info.nested.hello }}"
17+
"-----",
18+
"The number id **{{ info.num }}** and the number again {{ info.txt }} in {{ info.nested.hello }}",
19+
"one: {{info.description.1}}",
20+
"All: {{info.description}}",
21+
"All: {{info.test}}"
1222
],
1323

1424

src/Hyperdata.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ function createInstance(defaultData) {
1111
if (key) {
1212
if (DATA[key] == undefined) {
1313
DATA[key] = fetch(key)
14-
// .then(x => new Promise(resolve => setTimeout(() => resolve(x), Math.random()*10000)))
15-
.then(x => new Promise(resolve => setTimeout(() => resolve(x), 500)))
1614
.then(r => r.json());
1715
}
1816
return DATA[key];
@@ -27,7 +25,6 @@ function createInstance(defaultData) {
2725

2826
const data = await getData(url);
2927
const ret = path.split(".").reduce((acc, cur) => acc[(cur+"").trim()], data);
30-
console.log(ret);
3128
return ret;
3229
}
3330

0 commit comments

Comments
 (0)