Differences Between Two Approaches for Creating Branded Schema Classes

Are there significant differences between these two approaches when it comes to creating branded Schema classes?
I've found the below in this channel
export declare const TypeId1: unique symbol;
export interface TaggedPerson {
  readonly [TypeId1]: unique symbol;
}
export class TaggedPerson extends Schema.TaggedClass<TaggedPerson>()(
  "TaggedPerson",
  { name: Schema.String }
) {}

This approach is used in most of the effect codebase, which appears to be more complex
// Effect package style
export const TypeId2: unique symbol = Symbol.for("@mypackage");
export type TypeId2 = typeof TypeId2;
export class TaggedPerson2 extends Schema.TaggedClass<TaggedPerson2>()(
  "TaggedPerson2",
  { name: Schema.String }
) {
  readonly [TypeId2]: TypeId2 = TypeId2;
  [Inspectable.NodeInspectSymbol]() {
    return {
      _tag: "TaggedPerson2",
      hash: this.name,
    };
  }
}
Was this page helpful?