Passing Arguments in Effect-Based Programs

Maybe it's staring at me in the face and I'm just being dumb xD. But let's say I have a program and I want the program to require passing it in some arguments like you would a normal function, what's the Effect way of doing this?

Is the below the best practice?

const MainLayer = Layer.empty

const ProgramRuntime = ManagedRuntime.make(MainLayer);

const program = (options: Options) => Effect.gen(function* () {
  return Effect.success(null)
});

export const createClient = (options: Options) => ProgramRuntime .runSync(program(options));
Was this page helpful?