Skip to content

Collapse attr() and Attr() into a single export #94

Open
@wadetandy

Description

@wadetandy

Currently we export attr and Attr in our module. The former is to support the ES5 model API:

JSORMBase.extend({
  attrs: {
    name: attr(String)
  }
})

while the latter is a decorator for typescript (and hopefully soon standard JS) class syntax:

@Model()
class MyModel extends JSORMBase {
  @Attr name : string
}

With a bit of runtime checking, we should be able to collapse these into a single export to help avoid confusion going forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions