Design Patterns · Middle · Question 26 of 75

Why does every slice in FSD have a public API (index.ts)?

Explanation

A public API is the module's contract (a Facade): the internal structure can change as long as the exports don't. A linter (Steiger, eslint plugins) forbids "deep" imports that bypass index.

Further reading

Problem with a question

Design Patterns · Middle · question 26

Test yourself

Take the Design Patterns · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz