Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Work towards using ES6 #24

Open
darkf opened this issue Jul 10, 2016 · 3 comments
Open

Work towards using ES6 #24

darkf opened this issue Jul 10, 2016 · 3 comments

Comments

@darkf
Copy link
Owner

darkf commented Jul 10, 2016

ES6 is becoming more and more supported, and it offers some very nice features (const, let, destructuring, Map, Set, etc.)

TypeScript transpiles a lot of these, but the codebase doesn't use much of them (in particular I recall wrapping some blocks in lambdas to mimic let.)

const should be defaulted to when making bindings we won't change, and let otherwise.

We may also use for(let x of xs) ... for loops over arrays, and Object.assign for cloning/mass-assigning objects.

@darkf
Copy link
Owner Author

darkf commented Feb 2, 2017

Arrow functions are some of the most useful for this. I ported worldmap.ts to ES6. The other files still remain.

@darkf
Copy link
Owner Author

darkf commented Nov 27, 2017

Like I said in #101:

A lot of the callback hell spaghetti can be replaced with promises (which as a huge benefit makes our asynchronous code composable, and will replace monsters like the image loading stuff -- we can use Promise.all instead).

@darkf
Copy link
Owner Author

darkf commented Dec 8, 2017

We might also want to target ES6 natively (since it's supported by a large majority of modern browsers) in TypeScript ("target": "ES6"} and use ES6 libs.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant