mirror of
https://github.com/flarum/core.git
synced 2025-08-04 23:47:32 +02:00
common: remove Bus, fix typing for requestError
This commit is contained in:
@@ -95,7 +95,7 @@ export default abstract class Application {
|
|||||||
* An Alert that was shown as a result of an AJAX request error. If present,
|
* An Alert that was shown as a result of an AJAX request error. If present,
|
||||||
* it will be dismissed on the next successful request.
|
* it will be dismissed on the next successful request.
|
||||||
*/
|
*/
|
||||||
private requestError: Alert | null = null;
|
private requestError: RequestError | null = null;
|
||||||
|
|
||||||
data!: ApplicationData;
|
data!: ApplicationData;
|
||||||
|
|
||||||
|
@@ -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);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user