ashish-sdk
Version:
ThoughtSpot Embed SDK
17 lines • 489 B
JavaScript
import { EmbedEvent } from '../types';
export function getViewPropsAndListeners(props) {
return Object.keys(props).reduce((accu, key) => {
if (key.startsWith('on')) {
const eventName = key.substr(2);
accu.listeners[EmbedEvent[eventName]] = props[key];
}
else {
accu.viewConfig[key] = props[key];
}
return accu;
}, {
viewConfig: {},
listeners: {},
});
}
//# sourceMappingURL=util.js.map