Skip to content

Commit

Permalink
fix(common): remove dispose method from container service abstract class
Browse files Browse the repository at this point in the history
- the `dispose` method should be optional and not always required
  • Loading branch information
ghiscoding committed Jul 7, 2022
1 parent 5cf5e3d commit 838fc54
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ describe('Container Service', () => {
expect(() => ContainerService.prototype.get!('MyService')).toThrow('ContainerService "get" method must be implemented');
});

it('should display a not implemented when calling "dispose" method', () => {
expect(() => ContainerService.prototype.dispose!()).toThrow('ContainerService "dispose" method must be implemented');
});

it('should display a not implemented when calling "registerInstance" method', () => {
expect(() => ContainerService.prototype.registerInstance('MyService', {})).toThrow('ContainerService "registerInstance" method must be implemented');
});
Expand Down
4 changes: 0 additions & 4 deletions packages/common/src/services/container.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ export class ContainerService {
throw new Error('ContainerService "get" method must be implemented');
}

dispose() {
throw new Error('ContainerService "dispose" method must be implemented');
}

registerInstance(_key: any, _instance: any) {
throw new Error('ContainerService "registerInstance" method must be implemented');
}
Expand Down

0 comments on commit 838fc54

Please sign in to comment.