purescript-node-workers/src/Node.Worker.Environment.js
2023-12-23 19:20:56 -06:00

9 lines
353 B
JavaScript

import * as worker from 'node:worker_threads'
/** @type {(k: worker.Serializable) => () => unknown} */
export const getEnvironmentDataImpl = k => () => worker.getEnvironmentData(k)
/** @type {(k: worker.Serializable) => (v: worker.Serializable) => () => void} */
export const setEnvironmentDataImpl = k => v => () =>
worker.setEnvironmentData(k, v)