Externalized event-storage
This commit is contained in:
parent
35c988aeff
commit
364ffe975d
3
events.json
Normal file
3
events.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[
|
||||||
|
{"name" : "Easterhegg19", "description" : "EH19: Bun Intended!", "date" : "2019-04-19T10:00:00.000+01:00"}
|
||||||
|
]
|
8
timer.js
8
timer.js
@ -1,11 +1,11 @@
|
|||||||
(function(window) {
|
(function(window) {
|
||||||
|
|
||||||
function fetchEvents() {
|
function fetchEvents() {
|
||||||
const events = [
|
|
||||||
{name: "EH19", date: "2019-04-19T10:00:00.000+01:00", description: "Wien c:"}
|
|
||||||
];
|
|
||||||
return new Promise((fullfill, reject) => {
|
return new Promise((fullfill, reject) => {
|
||||||
fullfill(events)
|
fetch('./events.json')
|
||||||
|
.then(answer => answer.json())
|
||||||
|
.then(events => fullfill(events))
|
||||||
|
.catch(err => reject(err))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user