diff options
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/index.ts b/src/index.ts index 6390017..1c2035f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import MapData from './model/MapData'; -import Renderer from './view/Renderer'; import {loadMap} from './view/MapLoader'; +import Renderer from './view/Renderer'; window.onload = () => { const canvas = document.getElementById('rpgedit') as HTMLCanvasElement; @@ -10,15 +10,15 @@ window.onload = () => { const renderer = new Renderer(canvas); - let xhr = new XMLHttpRequest(); + const xhr = new XMLHttpRequest(); - xhr.addEventListener('load', async function() { - let mapDef = new MapData(JSON.parse(this.responseText)); + xhr.addEventListener('load', async function() { + const mapDef = new MapData(JSON.parse(this.responseText)); - let mapView = await loadMap(renderer, mapDef); - mapView.draw(); - }); + const mapView = await loadMap(renderer, mapDef); + mapView.draw(); + }); - xhr.open('GET', 'resources/map/test.json', true); - xhr.send(); + xhr.open('GET', 'resources/map/test.json', true); + xhr.send(); }; |