Creating an `RpcGroup` with handlers defined using `toLayerHandler` involves understanding how to...

How do I construct an RpcGroup if I define my handler using toLayerHandler? There is a single mention of this method in a test file and cannot find any other documentation. Is there a compelling reason to use .toLayer vs .toLayerHandler?

import { Effect, Layer } from 'effect';
import { CustomerRpcGroup } from './rpc.js';

const ListCustomersHandler = CustomerRpcGroup.toLayerHandler('@app/customers/list', () =>
  Effect.gen(function* () {
    return yield* Effect.succeed([]);
  })
);

export const CustomerRpcGroupLive = // how to construct a group with handlers???
Was this page helpful?