common: remove Bus, fix typing for requestError

This commit is contained in:
David Sevilla Martin 2020-03-19 11:32:36 -04:00
parent c95f7b89bf
commit 2a6360216e
No known key found for this signature in database
GPG Key ID: F764F1417E16B15F
2 changed files with 1 additions and 18 deletions

View File

@ -95,7 +95,7 @@ export default abstract class Application {
* An Alert that was shown as a result of an AJAX request error. If present,
* it will be dismissed on the next successful request.
*/
private requestError: Alert | null = null;
private requestError: RequestError | null = null;
data!: ApplicationData;

View File

@ -1,17 +0,0 @@
import forEach from 'lodash/forEach';
import get from 'lodash/get';
import set from 'lodash/set';
export default class Bus {
subscribers = {};
subscribe(event, callable) {
set(this.subscribers, event + '[]', callable);
}
dispatch(event, args: any = null) {
forEach(get(this.subscribers, event), function(listener) {
listener(event, args);
});
}
}