Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support model creation w/o registry #286

Open
2 tasks
ampatspell opened this issue Feb 18, 2022 · 0 comments
Open
2 tasks

Support model creation w/o registry #286

ampatspell opened this issue Feb 18, 2022 · 0 comments

Comments

@ampatspell
Copy link
Owner

@name('other') // for @model / @models .named()
class Other extends Model {

  constructor(owner, props) {
    super(owner);
  }

}

export default class Thing extends Model {

  @model()
    .named(({ type }) => type === 'other' ? Other : Foo)
    .mapping(thing => ({ })
  other;

}
  • create model using provided factory (@model and @models)
  • support model recreation based on model name which is set using @name decorator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant