mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 17:57:04 +08:00
common: remove Bus, fix typing for requestError
This commit is contained in:
parent
c95f7b89bf
commit
2a6360216e
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user