reactive-di
Advanced tools
Comparing version 2.3.5 to 2.3.6
@@ -55,3 +55,9 @@ 'use strict'; | ||
/** | ||
* Main dependency injection container | ||
*/ | ||
var Di = (_temp = _class = function () { | ||
/** | ||
* String name of container | ||
*/ | ||
function Di(componentFactory, createStyleSheet, handlers, adapter, metaRegistry, displayName, collector, mdlFactory) { | ||
@@ -92,2 +98,7 @@ _classCallCheck(this, Di); | ||
/** | ||
* Create new copy of container and inherit all resolved dependencies | ||
*/ | ||
Di.prototype.create = function create(displayName) { | ||
@@ -176,2 +187,3 @@ return new Di(this._componentFactory, null, this._handlers, this.adapter, this._metaRegistry.copy(), this.displayName + '.' + displayName, this._collector, this._mdlFactory).values(this.defaults); | ||
} | ||
lc.onUpdate(value.get()); | ||
} | ||
@@ -178,0 +190,0 @@ collector.end(info.lcs, lc); |
{ | ||
"name": "reactive-di", | ||
"version": "2.3.5", | ||
"version": "2.3.6", | ||
"description": "Reactive dependency injection", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -1,3 +0,5 @@ | ||
# reactive-di | ||
# Reactive DI [![Build Status](https://secure.travis-ci.org/zerkalica/reactive-di.png)](http://travis-ci.org/zerkalica/reactive-di) | ||
[![NPM](https://nodei.co/npm/reactive-di.png?downloads=true&stars=true)](https://nodei.co/npm/reactive-di/) | ||
Solution for dependency injection and state-management, state-to-css, state-to-dom rendering, data loading, optimistic updates and rollbacks. | ||
@@ -15,3 +17,3 @@ | ||
We need good OO design with [Composition reuse](https://en.wikipedia.org/wiki/Composition_over_inheritance) and [SOLID](https://en.wikipedia.org/wiki/SOLID_(object-oriented_design) in complex javascript applications on sever and client. | ||
We need good OO design with [Composition reuse](https://en.wikipedia.org/wiki/Composition_over_inheritance) and [SOLID](https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)) in complex javascript applications on sever and client. | ||
@@ -22,5 +24,5 @@ Any stream is wrapper on top of domain data. We need to automate and move most of all reactive-data stream manipulations behind the scene. For example, [mobx](http://mobxjs.github.io/mobx/) is good there. | ||
We need to keep all components clean and usable without di-framework: decorators must be used only for additional metadata, not as wrappers. | ||
We need to keep all components clean and usable without di: decorators must be used only for additional metadata, not as wrappers. | ||
We need to remove dependencies at react-like frameworks from compiletime to runtime. It give posibility to create unified jsx-based zero-dependency component, which can be used in any jsx-compatible render-to-dom library. | ||
We need to move dependencies at react-like frameworks from compiletime to runtime. It give posibility to create unified jsx-based zero-dependency component, which can be used in any jsx-compatible render-to-dom library. | ||
@@ -32,6 +34,7 @@ We need to provide unified cssx-based component which can be used in any jss-compatible render-to-css library. | ||
``` | ||
npm install reactive-di babel-plugin-transform-metadata | ||
npm install --save reactive-di | ||
npm install --save-dev babel-plugin-transform-metadata | ||
``` | ||
For using unified components, we need to define jsx pragma in transform-metadata: | ||
For using zero-dependency components, we need to define jsx pragma in transform-metadata: | ||
@@ -53,3 +56,3 @@ .babelrc: | ||
reactive-di requires some polyfills: Promise, Observable (only if observables used in application code), Map, Proxy (only for middlewares). | ||
reactive-di requires some polyfills: Promise, Observable (only if observables used in application code), Map, Set, Proxy (only for middlewares). | ||
@@ -56,0 +59,0 @@ ## Basics |
@@ -31,3 +31,9 @@ // @flow | ||
/** | ||
* Main dependency injection container | ||
*/ | ||
export default class Di { | ||
/** | ||
* String name of container | ||
*/ | ||
displayName: string | ||
@@ -46,2 +52,3 @@ stopped: Atom<boolean> | ||
static uniqId: number = 1 | ||
constructor( | ||
@@ -87,2 +94,5 @@ componentFactory?: ?ComponentFactory, | ||
/** | ||
* Create new copy of container and inherit all resolved dependencies | ||
*/ | ||
create(displayName: string): IContext { | ||
@@ -180,2 +190,3 @@ return (new Di( | ||
} | ||
lc.onUpdate(value.get()) | ||
} | ||
@@ -182,0 +193,0 @@ collector.end(info.lcs, lc) |
@@ -14,2 +14,5 @@ // @flow | ||
/** | ||
* Life cycle hooks | ||
*/ | ||
export interface LifeCycle<Dep> { | ||
@@ -16,0 +19,0 @@ /** |
@@ -17,3 +17,6 @@ // @flow | ||
export interface IContext extends IDi { | ||
/** | ||
* Context, used internally by di handlers | ||
*/ | ||
export type IContext = { | ||
stopped: Atom<boolean>; | ||
@@ -30,2 +33,2 @@ | ||
register(registered?: ?RegisterDepItem[]): IContext; | ||
} | ||
} & IDi |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
329635
5135
640