integreat
Version:
Node.js integration layer
18 lines • 738 B
JavaScript
import debugLib from 'debug';
const debug = debugLib('great');
export default async function listen(services, dispatch) {
for (const service of services) {
debug(`Listen to service '${service.id}' ...`);
const response = await service.listen(dispatch);
if (response.status !== 'ok' && response.status !== 'noaction') {
debug(`Could not listen to service '${service.id}'. [${response.status}] ${response.error}`);
return {
status: 'error',
error: `Could not listen to service '${service.id}'. [${response.status}] ${response.error}`,
};
}
debug('... ok');
}
return { status: 'ok' };
}
//# sourceMappingURL=listen.js.map