Skip to content

Commit

Permalink
fix(sloth-entity): cast constructor as a BaseEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
vinz243 committed Apr 21, 2018
1 parent ba1447b commit 9e09a3d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/decorators/SlothEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ export default function SlothEntity<S extends { _id: string }>(name: string) {
const data = getProtoData(constructor.prototype, true)

data.name = name

return class WrappedEntity extends constructor as EntityConstructor<
any,
any
> {
const BaseEntity = constructor as EntityConstructor<any, any>
return class WrappedEntity extends BaseEntity {
constructor(factory: PouchFactory<S>, idOrProps: Partial<S> | string) {
super(factory, idOrProps)
this.sloth.props = mapPropsOrDocToDocument(
Expand Down

0 comments on commit 9e09a3d

Please sign in to comment.