1
0
Fork 0
mirror of synced 2024-09-18 02:08:34 +12:00
budibase/packages/builder/src/common/eventHandlers.js

26 lines
750 B
JavaScript
Raw Normal View History

2019-09-24 17:11:02 +12:00
import {
eventHandlers
} from "../../../client/src/state/eventHandlers";
2019-10-19 05:32:03 +13:00
import {writable} from "svelte/store";
2019-09-24 17:11:02 +12:00
export {
EVENT_TYPE_MEMBER_NAME
} from "../../../client/src/state/eventHandlers";
2019-10-19 05:32:03 +13:00
import {
createCoreApi
} from "../../../client/src/core";
export const allHandlers = (appDefinition, user) => {
const coreApi = createCoreApi(appDefinition, user);
appDefinition.hierarchy = coreApi.templateApi.constructHierarchy(appDefinition.hierarchy);
const store = writable({
_bbuser: user
});
2019-09-24 17:11:02 +12:00
2019-10-19 05:32:03 +13:00
const handlersObj = eventHandlers(store, coreApi);
2019-09-24 17:11:02 +12:00
const handlersArray = [];
for(let key in handlersObj) {
handlersArray.push({name:key, ...handlersObj[key]});
}
return handlersArray;
}