1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 13:41:57 +02:00
onion/js/stores/webhook_store.js

28 lines
572 B
JavaScript
Raw Normal View History

2015-11-27 03:24:37 +01:00
'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');