mirror of
https://github.com/ascribe/onion.git
synced 2024-06-30 13:41:57 +02:00
28 lines
572 B
JavaScript
28 lines
572 B
JavaScript
|
'use strict';
|
||
|
|
||
|
import { alt } from '../alt';
|
||
|
import WebhookActions from '../actions/webhook_actions';
|
||
|
|
||
|
|
||
|
class WebhookStore {
|
||
|
constructor() {
|
||
|
this.webhooks = {};
|
||
|
this.events = {};
|
||
|
this.bindActions(WebhookActions);
|
||
|
}
|
||
|
|
||
|
onUpdateWebhooks(webhooks) {
|
||
|
this.webhooks = webhooks;
|
||
|
}
|
||
|
|
||
|
onUpdateEvents(events) {
|
||
|
this.events = events;
|
||
|
}
|
||
|
|
||
|
onRemoveWebhook(id) {
|
||
|
this.webhooks = this.webhooks.filter((webhook) => webhook.id !== parseInt(id));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default alt.createStore(WebhookStore, 'WebhookStore');
|