A Tag identifies a service type and provides a unique identifier. Used for dependency injection with IO effects.
// Define service interfacesinterface UserService { getUser(id: string): IO<never, Error, User>}// Create a tag for the serviceconst UserService = Tag<UserService>("UserService")// Use in effectsconst getUser = (id: string) => IO.service(UserService).flatMap(svc => svc.getUser(id)) Copy
// Define service interfacesinterface UserService { getUser(id: string): IO<never, Error, User>}// Create a tag for the serviceconst UserService = Tag<UserService>("UserService")// Use in effectsconst getUser = (id: string) => IO.service(UserService).flatMap(svc => svc.getUser(id))
The service type this tag identifies
Readonly
Unique identifier for this tag
String representation
A Tag identifies a service type and provides a unique identifier. Used for dependency injection with IO effects.
Example