Helper to make the handler type opaque. Workaround for TypeScript's inability to infer the handler type from the operation definition:
error TS2742: The inferred type of 'default' cannot be named without a reference. Copy
error TS2742: The inferred type of 'default' cannot be named without a reference.
Most of the time the exact handler type is not needed.
const MyOp = Operation.make({ input: Schema.Void, output: Schema.Void, meta: { key: 'my-op' }, services: [DatabaseService],});export default MyOp.pipe( Operation.withHandler( Effect.fn(function* (input) { return { result: 'ok' }; }), ), Operation.opaqueHandler,); Copy
const MyOp = Operation.make({ input: Schema.Void, output: Schema.Void, meta: { key: 'my-op' }, services: [DatabaseService],});export default MyOp.pipe( Operation.withHandler( Effect.fn(function* (input) { return { result: 'ok' }; }), ), Operation.opaqueHandler,);
Helper to make the handler type opaque. Workaround for TypeScript's inability to infer the handler type from the operation definition:
Most of the time the exact handler type is not needed.