Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better documentation #13

Open
ch1ller0 opened this issue Jan 22, 2022 · 2 comments
Open

Better documentation #13

ch1ller0 opened this issue Jan 22, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@ch1ller0
Copy link
Owner

  • I'm submitting a ...
    [ ] bug report
    [x] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    It goes without saying

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

@ch1ller0 ch1ller0 added the documentation Improvements or additions to documentation label Jan 22, 2022
@epodivilov
Copy link

Hi. Interesting project!

I see that it was inspired by ditox, but it would be interesting to know the differences/advantages of this solution.

@ch1ller0
Copy link
Owner Author

Hey! Ill include that in the docs but I want it to be here as well.
Ditox is great, but basically the idea was to implement a library that mimics the DI systems of Angular/Nest/Tramvai. So I might consider this as a wrapper around ditox`s system.
The main differences compared to ditox package are:

  • Different API, it is more constrained overall compared to ditox. In ditox you have to bind everything manually and one-after-another, which I find pretty risky sometimes. @fridgefm/inverter has more constraints when it comes to resolving/providing values.
  • In inverter you have no ability to dynamically add/remove providers. It is debatable, but for me it is rather a pro - all your providers are either resolved at start or the program simply wont work. In my opinion, in ditox it might come as an unpleasant surprise one day.
  • Inverter identifies cyclic dependecies and shows you a nice stack. Ditox goes to maximum call stack exceeded error instead.
  • Conception of modules is different. In inverter it is an entity that adds providers to the container, but in ditox it is rather yet another provider itself.
  • Inverter does not have react bindings(yet), ditox does.

To wrap it all up, it looks like ditox is a lot more like a library because it gives you full (and sometimes even too much) control, opposed to @fridgefm/inverter that is like a framework, where you just have to fill in the blanks. There might be some other differences but thats what came to my mind first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants