Effect CommunityEC
Effect Community3y ago
12 replies
steida

Comparing Interface vs Type for RandomBytes Function

What do you prefer for a service? Interface with a function or just a function?

export interface RandomBytes {
  readonly next: (
    bytesLength: number,
  ) => Effect.Effect<never, never, Uint8Array>;
}


or

export type RandomBytes = (
  bytesLength: number,
) => Effect.Effect<never, never, Uint8Array>;
Was this page helpful?