Skip to content

Switch prop type and prop transform output type? #369

Description

@sisp

While adding the stringToBigIntTransform prop transform, I found it not very intuitive to give the prop the encoded type (e.g. string) and then apply a prop transform to get the desired type (e.g. bigint). Instead, I think the opposite order would be more intuitive, e.g.:

@model("M")
class M extends Model({
  int: prop<bigint>().withTransform(bigintToStringTransform()),
  date: prop<Date>().withTransform(dateToTimestampTransform()),
  // ...
}) {
  // ...
}

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions