Git Product home page Git Product logo

injectable-ts's Introduction

INJECTABLE-TS

Purely-functional strictly-typed IoC/DI for TypeScript.

Overview

This project aims at providing lightweight inversion of control (IoC) and dependency injection (DI) tooling for large JavaScript/TypeScript applications.

Motivation

While the concepts of IoC and DI are not new and there are multiple implementations of them available for JavaScript and TypeScript, most of them are built around the concept of a single container with all registered dependencies (or multiple containers).

While such approach might work for some projects, it still introduces tight coupling in the code. We have to either manually register all dependencies in such container (which can be quite tedious), or delegate it to a framework which will register them automatically on a single global container which makes the code not portable.

While the issues above might seem synthetic, there's still another major downside of such approach - there is no way to statically check whether all required dependencies are actually registered on the container. If any of requested dependencies is missing, container throws in runtime which makes the code impure and indeterminate.

So, the goals of this project are to:

  • provide a purely-functional solution for automatic IoC/DI
  • provide compile-time guarantees that all required dependencies are always available for the caller.

Features

  • 🤝 - strictly typed, your code can finally be trusted
  • λ - purely functional, your code is determinate, composable, without side-effects
  • 👻 - transparent, your code requires no additional infrastructure like containers and frameworks, it just works
  • ⚡️ - efficient, your code is cached and only runs when its dependencies change
  • ⚛️ - React integration, your code can be seamlessly integrated into any React application

Structure

The project is split into several packages, and you can find documentation for them in the corresponding readme files.

Changelog

Read more here

Contributions & Development

Repository structure

This repository is powered by nx. This means that subpackages are built into a single directory /dist.

Publishing

This repository uses lerna ONLY for bumping versions until it's supported natively by nx.

Make sure NOT to call lerna bootstrap and other commands.

lerna version <version>

Then

npm run deploy

injectable-ts's People

Contributors

devfive avatar raveclassic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.