1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/lib/event-hook.js

24 lines
575 B
JavaScript
Raw Normal View History

'use strict';
const {
FEATURE_CREATED,
FEATURE_UPDATED,
FEATURE_ARCHIVED,
FEATURE_REVIVED,
} = require('./event-type');
exports.addEventHook = (eventHook, eventStore) => {
eventStore.on(FEATURE_CREATED, data => {
eventHook(FEATURE_CREATED, data);
});
eventStore.on(FEATURE_UPDATED, data => {
eventHook(FEATURE_UPDATED, data);
});
eventStore.on(FEATURE_ARCHIVED, data => {
eventHook(FEATURE_ARCHIVED, data);
});
eventStore.on(FEATURE_REVIVED, data => {
eventHook(FEATURE_REVIVED, data);
});
};