Understanding Service Definition in Requirement Management with TypeScript

Looking in the documents I'm trying to understand the requirement management part and I saw there that you need to define a service by extending a class like so:
import { Effect, Context } from "effect"
 
class Random extends Context.Tag("MyRandomService")<
  Random,
  { readonly next: Effect.Effect<number> }
>() {}


Why is that?
Was this page helpful?