Skip to content

StanHannebelle/circular-dep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Circular Dependencies Trainer

This repo presents 3 snippets of code containing circular dependencies. The goal is to solve each of these circular dependencies.

How to spot a circular dependency

Running yarn test-circular enables to identify circular dependencies.

If you are not familiar with dependency-cruiser, feel free to have a look at their documentation: https://github.com/sverweij/dependency-cruiser

Exercises

Exercise 1

This is an example of files in a common folder importing each other through the index.ts file of the folder

image

Exercise 2

Here, the circular dependency is due to a poor file architecture as files and variable instantiations are not splitted accordingly to the business logic.

image

Exercise 3

This is a more complex variant of Exercise 2.

image

Solution

A PR containing the solutions of the 3 examples is opened. Each commit of the PR corresponds to the solution to one example.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published