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

Implement @repository(model, dataSource) injection #392

Merged
merged 1 commit into from
Jun 28, 2017

Conversation

raymondfeng
Copy link
Contributor

@@ -24,15 +25,15 @@ export class RepositoryMetadata {
/**
* Class of the model
*/
modelClass?: Class<Model>;
modelClass?: typeof juggler.PersistedModel | typeof Model;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Are there any other places where Class<T> can be replaced with typeof T? Can we perhaps get rid of Class<> entirely?

}
return new DefaultCrudRepository(
modelClass as typeof juggler.PersistedModel,
dataSource! as juggler.DataSource);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if dataSource is null? Shouldn't we report a helpful error in such case?

@raymondfeng raymondfeng changed the title WIP: Implement @repository(model, dataSource) injection Implement @repository(model, dataSource) injection Jun 27, 2017
@raymondfeng raymondfeng merged commit 4bb84bb into master Jun 28, 2017
@raymondfeng raymondfeng deleted the implement-repo-factory branch June 29, 2017 17:53
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

Successfully merging this pull request may close these issues.

None yet

2 participants