なんかもうめっちゃ変えた

Closes #940
This commit is contained in:
syuilo 2017-11-23 05:43:00 +09:00
parent 1809800980
commit 3f8ebac466
46 changed files with 244 additions and 225 deletions

View file

@ -1,6 +1,7 @@
declare const _API_URL_: string;
import { EventEmitter } from 'eventemitter3';
import * as ReconnectingWebsocket from 'reconnecting-websocket';
import CONFIG from '../config';
/**
* Misskey stream connection
@ -24,7 +25,7 @@ export default class Connection extends EventEmitter {
this.state = 'initializing';
this.buffer = [];
const host = CONFIG.apiUrl.replace('http', 'ws');
const host = _API_URL_.replace('http', 'ws');
const query = params
? Object.keys(params)
.map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k]))