UNPKG

putout

Version:

🐊 Pluggable and configurable code transformer with built-in ESLint, Babel and support of js, jsx, typescript, flow, markdown, yaml and json

18 lines (12 loc) 331 B
import fullstore from 'fullstore'; const noop = () => {}; export const createIsStop = (parentPort) => { if (!parentPort) return noop; const isStop = fullstore(false); parentPort?.on('message', ([event]) => { if (event === 'stop') isStop(true); }); return isStop; };