Skip to content

Commit cd72b9c

Browse files
committed
fix: using interval instead of timeout to fake Observable share
1 parent f7fe450 commit cd72b9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/translate.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ export class TranslateService {
123123

124124
// todo use share() on observable instead of this hack once Angular 2 has been updated to RxJS 5.0.0.alpha-6 and remove this
125125
this.pending = Observable.create((subscriber: any) => {
126-
var timeoutId = setTimeout(() => {
126+
var intervalId = setInterval(() => {
127127
if(typeof observable === 'undefined') {
128-
clearTimeout(timeoutId);
128+
clearTimeout(intervalId);
129129
subscriber.next(this.translations[lang]);
130130
}
131131
}, 30);

0 commit comments

Comments
 (0)