Questions tagged [barrel-import]

3 questions
0
votes
0 answers

Spying on useReducer in Jest to make it return mock function to assert on, Mock never called

I have a React application to be tested. The application uses the useReducer()-Pattern and creates a dispatch function. As it´s neiter easy nor useful to assert on the state directly, I want to do my asserts against the input values of the dispatch…
0
votes
1 answer

How to force the use of barrel files in Typescript

I want to bring modularity into my typescript application and build different modules. Inside the modules I want to hide classes that should not be used outside the module. I currently have one ts-file for every class, which requires me to export…
0
votes
1 answer

How to use angular component when using barrels module (shared module)

I'd like to migrate my project to use standalone component. But I'm using quite a lot of "Barrel imports" What's a barrel? So, I just added the following to my component @Component({ standalone: true, // ... }) export class SharedComponent { …
Raphaël Balet
  • 6,334
  • 6
  • 41
  • 78