Files
privacy.sexy/src/presentation/components/Shared/Hooks/UseApplication.ts
undergroundwires ae75059cc1 Increase testability through dependency injection
- Remove existing integration tests for hooks as they're redundant after
  this change.
- Document the pattern in relevant documentation.
- Introduce `useEnvironment` to increase testability.
- Update components to inject dependencies rather than importing hooks
  directly.
2023-08-15 18:11:30 +02:00

12 lines
248 B
TypeScript

import { IApplication } from '@/domain/IApplication';
export function useApplication(application: IApplication) {
if (!application) {
throw new Error('missing application');
}
return {
application,
info: application.info,
};
}