Effect CommunityEC
Effect Community15mo ago
2 replies
jessekelly

Type Error When Accessing Model Fields

It seems like accessing fields on the model type no longer works. Is this expected? https://effect.website/play#0c56fea35462

import { Model } from "@effect/sql";
import { DateTime } from "effect";


export class Event extends Model.Class<Event>("Event")({
    startsAt: Model.DateTimeFromDate,
}) {}

/**
 * Whether the event has already ended.
 */
export const isPast = (event: Event) => DateTime.isPast(event.endsAt) // type error
Was this page helpful?