These are chat archives for TypeStrong/atom-typescript

12th
May 2015
Basarat Ali Syed
@basarat
May 12 2015 00:07
@kpgarrod cmd+shift+m should work now 4.2.4 published
Nelo Mitranim
@Mitranim
May 12 2015 05:39
@basarat every time I read your name I'm reminded of this: http://hatsuyuki-fansubs.com/shinmai-maou-no-testament (NSFW), the hell :D
Basarat Ali Syed
@basarat
May 12 2015 05:49
:rose:
Philipp Knecht
@fopsdev
May 12 2015 06:49
experimenting with atom-typescript. having a lot of fun so far :smile: btw. @mtraynham : any plans for typescript definitions for https://github.com/mtraynham/lodash-joins?
kpgarrod
@kpgarrod
May 12 2015 07:24
@fopsdev @mtraynham that's a really interesting library - surprising what you pick up in unexpected places
kpgarrod
@kpgarrod
May 12 2015 09:49
are es6 promises implemented in the Typescript that a-t uses?
Nelo Mitranim
@Mitranim
May 12 2015 09:51
Promise is a native API, you'll have to polyfill it for old environments. If you mean promise definitions, then apparently they're not yet included into the standard distribution =/
kpgarrod
@kpgarrod
May 12 2015 09:54
I was thinking of Promise, not the defs. I suppose my question was whether Typescript provides a polyfill and I take it the answer is no
Nelo Mitranim
@Mitranim
May 12 2015 09:56
Yeah it's not something the transpiler can inline, this is the de facto polyfill and it's not that small
kpgarrod
@kpgarrod
May 12 2015 10:16
@mitranim: thanks. I am using angular 1.x, so I have $q, but I've got an issue that has been driving me crazy
Nelo Mitranim
@Mitranim
May 12 2015 10:16
@kpgarrod you should use tsd and download angular definitions
kpgarrod
@kpgarrod
May 12 2015 10:16
I use this kind of syntax: this.canActivate().then(this.activate); quite a lot
Nelo Mitranim
@Mitranim
May 12 2015 10:17
your promise signatures will look like this: ng.IPromise<any>
kpgarrod
@kpgarrod
May 12 2015 10:17
I have angular definitions
Nelo Mitranim
@Mitranim
May 12 2015 10:17
alright then
getting ahead of myself
so what's the issue
kpgarrod
@kpgarrod
May 12 2015 10:17
the problem with that syntax is that 'this' seems to get messed up
this.canActivate().then(() => { this.activate() });
works
Nelo Mitranim
@Mitranim
May 12 2015 10:18
yes that's what you'll have to do
or .then(this.activate.bind(this))
no other way around this
kpgarrod
@kpgarrod
May 12 2015 10:19
mmm, that is a big pain
Nelo Mitranim
@Mitranim
May 12 2015 10:19
yeah that's a bit of a pain
we'll have to live with this
kpgarrod
@kpgarrod
May 12 2015 10:19
OK, yes that bind is a good idea
Nelo Mitranim
@Mitranim
May 12 2015 10:19
it's slower than .then(() => this.activate())
kpgarrod
@kpgarrod
May 12 2015 10:20
probably milliseconds though right?
Nelo Mitranim
@Mitranim
May 12 2015 10:20
a millisecond is a big deal...
anyway .bind is slower so use a function if you can
kpgarrod
@kpgarrod
May 12 2015 10:20
if there are millions of them
got it
thanks
Basarat Ali Syed
@basarat
May 12 2015 12:09
@kpgarrod this.canActivate().then(this.activate) would work if you define active as a lambda instead i.e. activate = ()=> instead of activate()
basically push the lambda to the point of definition instead of point of usage ;)
kpgarrod
@kpgarrod
May 12 2015 12:23
@basarat: wow! I'm not sure I love the syntax, but I bow to your knowledge of the language
kpgarrod
@kpgarrod
May 12 2015 13:23
say I have a file(1) with a number of imports (e.g. all the controllers in my app) and I want to import all of those controllers into two other files(2,3). How do I export all the imports from file 1 and re-import them to files 2 & 3?
Basarat Ali Syed
@basarat
May 12 2015 21:51
@kpgarrod export * from "file"