Creating Tags with Factory Functions in TypeScript

is there a builtin way to create tags using a factory function like this? Seems to be a lot more concise then the class based alternative in the docs, but maybe i'm missing something.

const createTag = <
  T extends Record<PropertyKey, any> & Effect.Tag.ProhibitedType,
>(
  tag: string
) => Effect.Tag(tag)<typeof self, T>();

const Counter = createTag<Rx.Rx<number>>('@TestButton/Counter');
Was this page helpful?