All Projects → makeflow → entrance-decorator

makeflow / entrance-decorator

Licence: MIT license
A minimal solution of dependency injection for projects that scale.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to entrance-decorator

rodi
Implementation of dependency injection for Python 3
Stars: ✭ 42 (+68%)
Mutual labels:  dependency-injection
Griffin.Container
Inversion of control container with (almost) zero configuration
Stars: ✭ 13 (-48%)
Mutual labels:  dependency-injection
sqrs
🚌SQRS is a JavaScript library for implementing CQRS pattern.
Stars: ✭ 23 (-8%)
Mutual labels:  dependency-injection
graphql-server-typed
Using typescript and gql-code-gen for easy graphql setup
Stars: ✭ 32 (+28%)
Mutual labels:  dependency-injection
common-injector
Heavily influenced by Angular and it's dependency injection. Inspired by Angular and Indiv.
Stars: ✭ 18 (-28%)
Mutual labels:  dependency-injection
vanilla-di-manifesto
We love DI, but we don't use any DI libraries. Why?
Stars: ✭ 108 (+332%)
Mutual labels:  dependency-injection
sirius-kernel
Provides common core classes and the dependency injection microkernel powering all SIRIUS applications
Stars: ✭ 30 (+20%)
Mutual labels:  dependency-injection
telephone-ts
Telephone-ts: The "Event Emitter-less" TypeScript Event Architecture.
Stars: ✭ 22 (-12%)
Mutual labels:  dependency-injection
Slice
Slice - a framework which simplifies Sling/AEM development by using dependency injection pattern and mapping Sling resources into Java objects
Stars: ✭ 64 (+156%)
Mutual labels:  dependency-injection
phpstan-symfony
*DEPRECATED* Symfony extension for PHPStan
Stars: ✭ 42 (+68%)
Mutual labels:  dependency-injection
vue-ioc
IoC and DI for Vue powered by InversifyJS and inspired by Angular Module syntactic sugar.
Stars: ✭ 39 (+56%)
Mutual labels:  dependency-injection
movie-booking
An example for booking movie seat, combined of Android Data Binding, State Design Pattern and Multibinding + Autofactory. iOS version is: https://github.com/lizhiquan/MovieBooking
Stars: ✭ 80 (+220%)
Mutual labels:  dependency-injection
EasyDI
Easy Dependency Injection for Java
Stars: ✭ 46 (+84%)
Mutual labels:  dependency-injection
func-dependency-injection-go
Dependency injection example using higher order functions
Stars: ✭ 26 (+4%)
Mutual labels:  dependency-injection
dudulina
CQRS + Event Sourcing library for PHP
Stars: ✭ 53 (+112%)
Mutual labels:  dependency-injection
redi
💉 A dependency injection library for TypeScript & JavaScript, along with a binding for React.
Stars: ✭ 29 (+16%)
Mutual labels:  dependency-injection
pulp
Scala library for guiceless dependency injection
Stars: ✭ 26 (+4%)
Mutual labels:  dependency-injection
Zenject-2019
Dependency Injection Framework for Unity3D
Stars: ✭ 2,567 (+10168%)
Mutual labels:  dependency-injection
nodejs-boilerplate
Clean Architecture for node.js projects (Typescript + Express + TypeORM + Typedi)
Stars: ✭ 199 (+696%)
Mutual labels:  dependency-injection
Dazinator.Extensions.DependencyInjection
Useful additions to Microsoft.Extensions.DependencyInjection such as Named Services.
Stars: ✭ 26 (+4%)
Mutual labels:  dependency-injection

Entrance Decorator

A minimal solution of dependency injection for projects that scale.

Why

🙂

Installation

yarn add entrance-decorator

Usage

Define entrances

import {entrance} from 'entrance-decorator';

export class Entrances {
  constructor(private url: string) {}

  @entrance
  get uiService() {
    return new UIService(this.errorService);
  }

  @entrance
  get errorService() {
    return new ErrorService({
      baseURL: this.url,
    });
  }
}

Extend/override entrances

import {entrance} from 'entrance-decorator';

export class MobileEntrances extends Entrances {
  // Extend entrance
  @entrance
  get mobileService() {
    return new MobileService(this.errorService);
  }

  // Override entrance
  @entrance
  get uiService() {
    return new MobileUIService(this.errorService);
  }
}

Use entrances

const entrances = new Entrances('https://makeflow.com');

You may use the entrances object in whatever way you want. For example, we use Context in React (in a decorator manner) and use something like entrances.launchServer() in server-side applications.

What it does

Cache and circular dependency check, nothing else.

License

MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].