react-obsidian 0.0.40 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clearGraphs.js +2 -2
- package/dist/clearGraphs.js.map +1 -1
- package/dist/src/GraphProperties.js +9 -10
- package/dist/src/GraphProperties.js.map +1 -1
- package/dist/src/Obsidian.js +15 -18
- package/dist/src/Obsidian.js.map +1 -1
- package/dist/src/ProvidedPropertiesStore.js +13 -14
- package/dist/src/ProvidedPropertiesStore.js.map +1 -1
- package/dist/src/ReferenceCounter.js +9 -10
- package/dist/src/ReferenceCounter.js.map +1 -1
- package/dist/src/decorators/Graph.js +3 -4
- package/dist/src/decorators/Graph.js.map +1 -1
- package/dist/src/decorators/LifecycleBound.js +1 -1
- package/dist/src/decorators/LifecycleBound.js.map +1 -1
- package/dist/src/decorators/Memoize.js +3 -3
- package/dist/src/decorators/Memoize.js.map +1 -1
- package/dist/src/decorators/Singleton.js +1 -1
- package/dist/src/decorators/Singleton.js.map +1 -1
- package/dist/src/decorators/inject/Inject.js +4 -4
- package/dist/src/decorators/inject/Inject.js.map +1 -1
- package/dist/src/decorators/inject/Injectable.js +2 -2
- package/dist/src/decorators/inject/Injectable.js.map +1 -1
- package/dist/src/decorators/inject/LateInject.js +3 -3
- package/dist/src/decorators/inject/LateInject.js.map +1 -1
- package/dist/src/decorators/provides/MemoizeDescriptor.js +5 -9
- package/dist/src/decorators/provides/MemoizeDescriptor.js.map +1 -1
- package/dist/src/decorators/provides/Provides.js +3 -4
- package/dist/src/decorators/provides/Provides.js.map +1 -1
- package/dist/src/graph/CircularDependenciesDetector.d.ts +10 -0
- package/dist/src/graph/CircularDependenciesDetector.d.ts.map +1 -0
- package/dist/src/graph/CircularDependenciesDetector.js +24 -0
- package/dist/src/graph/CircularDependenciesDetector.js.map +1 -0
- package/dist/src/graph/ObjectGraph.d.ts +2 -1
- package/dist/src/graph/ObjectGraph.d.ts.map +1 -1
- package/dist/src/graph/ObjectGraph.js +20 -25
- package/dist/src/graph/ObjectGraph.js.map +1 -1
- package/dist/src/graph/PropertyRetriever.d.ts +2 -1
- package/dist/src/graph/PropertyRetriever.d.ts.map +1 -1
- package/dist/src/graph/PropertyRetriever.js +28 -20
- package/dist/src/graph/PropertyRetriever.js.map +1 -1
- package/dist/src/graph/PropertyRetrieverDelegate.d.ts +2 -1
- package/dist/src/graph/PropertyRetrieverDelegate.d.ts.map +1 -1
- package/dist/src/graph/ProviderBinder.js +3 -3
- package/dist/src/graph/ProviderBinder.js.map +1 -1
- package/dist/src/graph/ServiceLocatorFactory.js +9 -12
- package/dist/src/graph/ServiceLocatorFactory.js.map +1 -1
- package/dist/src/graph/VisitedNodes.d.ts +9 -0
- package/dist/src/graph/VisitedNodes.d.ts.map +1 -0
- package/dist/src/graph/VisitedNodes.js +28 -0
- package/dist/src/graph/VisitedNodes.js.map +1 -0
- package/dist/src/graph/registry/DefaultGraphResolver.js +5 -25
- package/dist/src/graph/registry/DefaultGraphResolver.js.map +1 -1
- package/dist/src/graph/registry/GraphMiddleware.js +3 -23
- package/dist/src/graph/registry/GraphMiddleware.js.map +1 -1
- package/dist/src/graph/registry/GraphMiddlewareChain.js +12 -14
- package/dist/src/graph/registry/GraphMiddlewareChain.js.map +1 -1
- package/dist/src/graph/registry/GraphRegistry.js +38 -41
- package/dist/src/graph/registry/GraphRegistry.js.map +1 -1
- package/dist/src/graph/registry/Middleware.js +11 -19
- package/dist/src/graph/registry/Middleware.js.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/injectors/class/ClassInjector.js +25 -40
- package/dist/src/injectors/class/ClassInjector.js.map +1 -1
- package/dist/src/injectors/class/ConstructorArgs.js +11 -12
- package/dist/src/injectors/class/ConstructorArgs.js.map +1 -1
- package/dist/src/injectors/class/InjectionMetadata.js +21 -22
- package/dist/src/injectors/class/InjectionMetadata.js.map +1 -1
- package/dist/src/injectors/class/LateInjector.js +12 -15
- package/dist/src/injectors/class/LateInjector.js.map +1 -1
- package/dist/src/injectors/components/ComponentInjector.js +18 -21
- package/dist/src/injectors/components/ComponentInjector.js.map +1 -1
- package/dist/src/injectors/components/InjectComponent.js +3 -3
- package/dist/src/injectors/components/InjectComponent.js.map +1 -1
- package/dist/src/injectors/components/PropsInjector.js +7 -9
- package/dist/src/injectors/components/PropsInjector.js.map +1 -1
- package/dist/src/injectors/components/useGraph.js +10 -10
- package/dist/src/injectors/components/useGraph.js.map +1 -1
- package/dist/src/injectors/hooks/HookInjector.js +12 -16
- package/dist/src/injectors/hooks/HookInjector.js.map +1 -1
- package/dist/src/injectors/hooks/InjectHook.js +2 -2
- package/dist/src/injectors/hooks/InjectHook.js.map +1 -1
- package/dist/src/observable/MediatorObservable.js +23 -34
- package/dist/src/observable/MediatorObservable.js.map +1 -1
- package/dist/src/observable/Observable.js +16 -22
- package/dist/src/observable/Observable.js.map +1 -1
- package/dist/src/observable/useObserver.js +4 -4
- package/dist/src/observable/useObserver.js.map +1 -1
- package/dist/src/utils/React.js +1 -1
- package/dist/src/utils/React.js.map +1 -1
- package/dist/test/fixtures/CircularDependencyFromSubgraph.d.ts +5 -0
- package/dist/test/fixtures/CircularDependencyFromSubgraph.d.ts.map +1 -0
- package/dist/test/fixtures/CircularDependencyFromSubgraph.js +30 -0
- package/dist/test/fixtures/CircularDependencyFromSubgraph.js.map +1 -0
- package/dist/test/fixtures/CircularDependencyGraph.d.ts +5 -0
- package/dist/test/fixtures/CircularDependencyGraph.d.ts.map +1 -0
- package/dist/test/fixtures/CircularDependencyGraph.js +29 -0
- package/dist/test/fixtures/CircularDependencyGraph.js.map +1 -0
- package/dist/test/fixtures/CircularDependencyGraph2.d.ts +7 -0
- package/dist/test/fixtures/CircularDependencyGraph2.d.ts.map +1 -0
- package/dist/test/fixtures/CircularDependencyGraph2.js +47 -0
- package/dist/test/fixtures/CircularDependencyGraph2.js.map +1 -0
- package/dist/test/fixtures/GraphWithOnBind.js +16 -36
- package/dist/test/fixtures/GraphWithOnBind.js.map +1 -1
- package/dist/test/fixtures/InjectedComponent.js +4 -7
- package/dist/test/fixtures/InjectedComponent.js.map +1 -1
- package/dist/test/fixtures/LifecycleBoundGraph.js +23 -42
- package/dist/test/fixtures/LifecycleBoundGraph.js.map +1 -1
- package/dist/test/fixtures/MainGraph.js +25 -45
- package/dist/test/fixtures/MainGraph.js.map +1 -1
- package/dist/test/fixtures/SingletonGraph.js +21 -39
- package/dist/test/fixtures/SingletonGraph.js.map +1 -1
- package/dist/test/fixtures/StringProvider.js +4 -6
- package/dist/test/fixtures/StringProvider.js.map +1 -1
- package/dist/test/fixtures/Subgraph.js +41 -61
- package/dist/test/fixtures/Subgraph.js.map +1 -1
- package/dist/test/fixtures/SubgraphWithCircularDependency.d.ts +6 -0
- package/dist/test/fixtures/SubgraphWithCircularDependency.d.ts.map +1 -0
- package/dist/test/fixtures/SubgraphWithCircularDependency.js +39 -0
- package/dist/test/fixtures/SubgraphWithCircularDependency.js.map +1 -0
- package/dist/test/fixtures/ThrowingMainGraph.js +15 -35
- package/dist/test/fixtures/ThrowingMainGraph.js.map +1 -1
- package/dist/test/fixtures/UniqueNumberGraph.js +27 -45
- package/dist/test/fixtures/UniqueNumberGraph.js.map +1 -1
- package/dist/testkit/index.js +12 -35
- package/dist/testkit/index.js.map +1 -1
- package/dist/transformers/babel-plugin-obsidian/helpers/index.js +11 -11
- package/dist/transformers/babel-plugin-obsidian/helpers/index.js.map +1 -1
- package/dist/transformers/babel-plugin-obsidian/index.js +8 -12
- package/dist/transformers/babel-plugin-obsidian/index.js.map +1 -1
- package/dist/transformers/babel-plugin-obsidian/unmagler/index.js +2 -2
- package/dist/transformers/babel-plugin-obsidian/unmagler/index.js.map +1 -1
- package/dist/transformers/babel-plugin-obsidian/unmagler/method.js +3 -3
- package/dist/transformers/babel-plugin-obsidian/unmagler/method.js.map +1 -1
- package/dist/transformers/babel-plugin-obsidian/unmagler/property.js +2 -2
- package/dist/transformers/babel-plugin-obsidian/unmagler/property.js.map +1 -1
- package/documentation/package-lock.json +1819 -88
- package/documentation/package.json +1 -0
- package/documentation/src/theme/SearchBar.js +21 -0
- package/package.json +2 -2
- package/src/graph/CircularDependenciesDetector.ts +23 -0
- package/src/graph/ObjectGraph.ts +7 -2
- package/src/graph/PropertyRetriever.ts +29 -6
- package/src/graph/PropertyRetrieverDelegate.ts +7 -1
- package/src/graph/VisitedNodes.ts +25 -0
- package/tsconfig.base.json +1 -1
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Observable = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
class Observable {
|
|
5
|
+
constructor(initialValue) {
|
|
6
6
|
this.subscribers = new Set();
|
|
7
7
|
this.currentValue = initialValue;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
enumerable: false,
|
|
18
|
-
configurable: true
|
|
19
|
-
});
|
|
20
|
-
Observable.prototype.subscribe = function (onNext) {
|
|
21
|
-
var _this = this;
|
|
9
|
+
get value() {
|
|
10
|
+
return this.currentValue;
|
|
11
|
+
}
|
|
12
|
+
set value(value) {
|
|
13
|
+
this.currentValue = value;
|
|
14
|
+
this.subscribers.forEach((subscriber) => subscriber(value));
|
|
15
|
+
}
|
|
16
|
+
subscribe(onNext) {
|
|
22
17
|
if (this.subscribers.has(onNext)) {
|
|
23
18
|
throw new Error('Subscriber already subscribed');
|
|
24
19
|
}
|
|
25
20
|
this.subscribers.add(onNext);
|
|
26
|
-
return
|
|
27
|
-
}
|
|
28
|
-
|
|
21
|
+
return () => this.subscribers.delete(onNext);
|
|
22
|
+
}
|
|
23
|
+
unsubscribe(onNext) {
|
|
29
24
|
if (!this.subscribers.has(onNext)) {
|
|
30
|
-
throw new Error(
|
|
25
|
+
throw new Error(`Can't unsubscribe, subscriber doesn't exist`);
|
|
31
26
|
}
|
|
32
27
|
this.subscribers.delete(onNext);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
}());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
36
30
|
exports.Observable = Observable;
|
|
37
31
|
//# sourceMappingURL=Observable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Observable.js","sourceRoot":"","sources":["../../../src/observable/Observable.ts"],"names":[],"mappings":";;;AAEA;
|
|
1
|
+
{"version":3,"file":"Observable.js","sourceRoot":"","sources":["../../../src/observable/Observable.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;IAIrB,YAAY,YAAgB;QAHpB,gBAAW,GAAmB,IAAI,GAAG,EAAE,CAAC;QAI9C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,YAAiB,CAAC;IAChC,CAAC;IAED,IAAW,KAAK,CAAC,KAAQ;QACvB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9D,CAAC;IAEM,SAAS,CAAC,MAAiB;QAChC,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;SAClD;QACD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;IAEM,WAAW,CAAC,MAAgB;QACjC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;SAChE;QACD,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACF;AA/BD,gCA+BC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useObserver = void 0;
|
|
4
4
|
/* eslint-disable no-param-reassign */
|
|
5
|
-
|
|
5
|
+
const react_1 = require("react");
|
|
6
6
|
function useObserver(observable) {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const [value, setValue] = (0, react_1.useState)(observable.value);
|
|
8
|
+
const onNext = (0, react_1.useCallback)((next) => {
|
|
9
9
|
observable.value = next;
|
|
10
10
|
}, [observable]);
|
|
11
|
-
(0, react_1.useEffect)(
|
|
11
|
+
(0, react_1.useEffect)(() => {
|
|
12
12
|
return observable.subscribe(setValue);
|
|
13
13
|
}, [observable]);
|
|
14
14
|
return [value, onNext];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useObserver.js","sourceRoot":"","sources":["../../../src/observable/useObserver.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC
|
|
1
|
+
{"version":3,"file":"useObserver.js","sourceRoot":"","sources":["../../../src/observable/useObserver.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,iCAAyD;AAGzD,SAAgB,WAAW,CAAI,UAAyB;IACtD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,IAAA,mBAAW,EAAC,CAAC,IAAO,EAAE,EAAE;QACrC,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC;IAC1B,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzB,CAAC;AAXD,kCAWC"}
|
package/dist/src/utils/React.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.genericMemo = exports.isMemoizedComponent = void 0;
|
|
7
|
-
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function isMemoizedComponent(component) {
|
|
9
9
|
return component.type !== undefined;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"React.js","sourceRoot":"","sources":["../../../src/utils/React.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"React.js","sourceRoot":"","sources":["../../../src/utils/React.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAiD;AAKjD,SAAgB,mBAAmB,CAAC,SAAiC;IACnE,OAAQ,SAA+B,CAAC,IAAI,KAAK,SAAS,CAAC;AAC7D,CAAC;AAFD,kDAEC;AAED,SAAgB,WAAW,CACzB,SAA2C,EAC3C,aAAgD;IAEhD,OAAO,eAAK,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAiB,CAAC;AAC9D,CAAC;AALD,kCAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularDependencyFromSubgraph.d.ts","sourceRoot":"","sources":["../../../test/fixtures/CircularDependencyFromSubgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAY,MAAM,WAAW,CAAC;AAGzD,qBACa,8BAA+B,SAAQ,WAAW;IAE7D,IAAI,CAAC,IAAI,EAAE,GAAG;CAGf"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CircularDependencyFromSubgraph = void 0;
|
|
13
|
+
const src_1 = require("../../src");
|
|
14
|
+
const SubgraphWithCircularDependency_1 = require("./SubgraphWithCircularDependency");
|
|
15
|
+
let CircularDependencyFromSubgraph = class CircularDependencyFromSubgraph extends src_1.ObjectGraph {
|
|
16
|
+
dep1(dep2) {
|
|
17
|
+
return dep2;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, src_1.Provides)(),
|
|
22
|
+
__metadata("design:type", Function),
|
|
23
|
+
__metadata("design:paramtypes", [Object]),
|
|
24
|
+
__metadata("design:returntype", void 0)
|
|
25
|
+
], CircularDependencyFromSubgraph.prototype, "dep1", null);
|
|
26
|
+
CircularDependencyFromSubgraph = __decorate([
|
|
27
|
+
(0, src_1.Graph)({ subgraphs: [SubgraphWithCircularDependency_1.SubgraphWithCircularDependency] })
|
|
28
|
+
], CircularDependencyFromSubgraph);
|
|
29
|
+
exports.CircularDependencyFromSubgraph = CircularDependencyFromSubgraph;
|
|
30
|
+
//# sourceMappingURL=CircularDependencyFromSubgraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularDependencyFromSubgraph.js","sourceRoot":"","sources":["../../../test/fixtures/CircularDependencyFromSubgraph.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAyD;AACzD,qFAAkF;AAG3E,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,iBAAW;IAE7D,IAAI,CAAC,IAAS;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAJC;IAAC,IAAA,cAAQ,GAAE;;;;0DAGV;AAJU,8BAA8B;IAD1C,IAAA,WAAK,EAAC,EAAE,SAAS,EAAE,CAAC,+DAA8B,CAAC,EAAE,CAAC;GAC1C,8BAA8B,CAK1C;AALY,wEAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularDependencyGraph.d.ts","sourceRoot":"","sources":["../../../test/fixtures/CircularDependencyGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAY,MAAM,WAAW,CAAC;AAEzD,qBACa,uBAAwB,SAAQ,WAAW;IAEtD,OAAO,CAAC,OAAO,EAAE,MAAM;CAGxB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CircularDependencyGraph = void 0;
|
|
13
|
+
const src_1 = require("../../src");
|
|
14
|
+
let CircularDependencyGraph = class CircularDependencyGraph extends src_1.ObjectGraph {
|
|
15
|
+
aString(aString) {
|
|
16
|
+
return aString;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, src_1.Provides)(),
|
|
21
|
+
__metadata("design:type", Function),
|
|
22
|
+
__metadata("design:paramtypes", [String]),
|
|
23
|
+
__metadata("design:returntype", void 0)
|
|
24
|
+
], CircularDependencyGraph.prototype, "aString", null);
|
|
25
|
+
CircularDependencyGraph = __decorate([
|
|
26
|
+
(0, src_1.Graph)()
|
|
27
|
+
], CircularDependencyGraph);
|
|
28
|
+
exports.CircularDependencyGraph = CircularDependencyGraph;
|
|
29
|
+
//# sourceMappingURL=CircularDependencyGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularDependencyGraph.js","sourceRoot":"","sources":["../../../test/fixtures/CircularDependencyGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAyD;AAGlD,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,iBAAW;IAEtD,OAAO,CAAC,OAAe;QACrB,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AAJC;IAAC,IAAA,cAAQ,GAAE;;;;sDAGV;AAJU,uBAAuB;IADnC,IAAA,WAAK,GAAE;GACK,uBAAuB,CAKnC;AALY,0DAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularDependencyGraph2.d.ts","sourceRoot":"","sources":["../../../test/fixtures/CircularDependencyGraph2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAY,MAAM,WAAW,CAAC;AAEzD,qBACa,wBAAyB,SAAQ,WAAW;IAEvD,IAAI,CAAC,IAAI,EAAE,GAAG;IAKd,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG;IAKpB,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG;CAGrB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CircularDependencyGraph2 = void 0;
|
|
13
|
+
const src_1 = require("../../src");
|
|
14
|
+
let CircularDependencyGraph2 = class CircularDependencyGraph2 extends src_1.ObjectGraph {
|
|
15
|
+
dep1(dep2) {
|
|
16
|
+
return dep2;
|
|
17
|
+
}
|
|
18
|
+
dep2(dep3) {
|
|
19
|
+
return dep3;
|
|
20
|
+
}
|
|
21
|
+
dep3(dep1) {
|
|
22
|
+
return dep1;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, src_1.Provides)(),
|
|
27
|
+
__metadata("design:type", Function),
|
|
28
|
+
__metadata("design:paramtypes", [Object]),
|
|
29
|
+
__metadata("design:returntype", void 0)
|
|
30
|
+
], CircularDependencyGraph2.prototype, "dep1", null);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, src_1.Provides)(),
|
|
33
|
+
__metadata("design:type", Function),
|
|
34
|
+
__metadata("design:paramtypes", [Object]),
|
|
35
|
+
__metadata("design:returntype", Object)
|
|
36
|
+
], CircularDependencyGraph2.prototype, "dep2", null);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, src_1.Provides)(),
|
|
39
|
+
__metadata("design:type", Function),
|
|
40
|
+
__metadata("design:paramtypes", [Object]),
|
|
41
|
+
__metadata("design:returntype", Object)
|
|
42
|
+
], CircularDependencyGraph2.prototype, "dep3", null);
|
|
43
|
+
CircularDependencyGraph2 = __decorate([
|
|
44
|
+
(0, src_1.Graph)()
|
|
45
|
+
], CircularDependencyGraph2);
|
|
46
|
+
exports.CircularDependencyGraph2 = CircularDependencyGraph2;
|
|
47
|
+
//# sourceMappingURL=CircularDependencyGraph2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularDependencyGraph2.js","sourceRoot":"","sources":["../../../test/fixtures/CircularDependencyGraph2.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAyD;AAGlD,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,iBAAW;IAEvD,IAAI,CAAC,IAAS;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,CAAC,IAAS;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,IAAI,CAAC,IAAS;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAdC;IAAC,IAAA,cAAQ,GAAE;;;;oDAGV;AAED;IAAC,IAAA,cAAQ,GAAE;;;;oDAGV;AAED;IAAC,IAAA,cAAQ,GAAE;;;;oDAGV;AAdU,wBAAwB;IADpC,IAAA,WAAK,GAAE;GACK,wBAAwB,CAepC;AAfY,4DAAwB"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -25,28 +10,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
25
10
|
};
|
|
26
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
12
|
exports.GraphWithOnBind = void 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function GraphWithOnBind() {
|
|
32
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
33
|
-
}
|
|
34
|
-
GraphWithOnBind.prototype.onBind = function (target) {
|
|
13
|
+
const src_1 = require("../../src");
|
|
14
|
+
let GraphWithOnBind = class GraphWithOnBind extends src_1.ObjectGraph {
|
|
15
|
+
onBind(target) {
|
|
35
16
|
this.target = target;
|
|
36
|
-
}
|
|
37
|
-
|
|
17
|
+
}
|
|
18
|
+
targetName() {
|
|
38
19
|
return this.target.name;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}(src_1.ObjectGraph));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, src_1.Provides)(),
|
|
24
|
+
__metadata("design:type", Function),
|
|
25
|
+
__metadata("design:paramtypes", []),
|
|
26
|
+
__metadata("design:returntype", String)
|
|
27
|
+
], GraphWithOnBind.prototype, "targetName", null);
|
|
28
|
+
GraphWithOnBind = __decorate([
|
|
29
|
+
(0, src_1.Graph)()
|
|
30
|
+
], GraphWithOnBind);
|
|
51
31
|
exports.GraphWithOnBind = GraphWithOnBind;
|
|
52
32
|
//# sourceMappingURL=GraphWithOnBind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphWithOnBind.js","sourceRoot":"","sources":["../../../test/fixtures/GraphWithOnBind.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GraphWithOnBind.js","sourceRoot":"","sources":["../../../test/fixtures/GraphWithOnBind.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAyD;AAGlD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,iBAAW;IAGrC,MAAM,CAAC,MAAW;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAGD,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;CACF,CAAA;AAJC;IAAC,IAAA,cAAQ,GAAE;;;;iDAGV;AAVU,eAAe;IAD3B,IAAA,WAAK,GAAE;GACK,eAAe,CAW3B;AAXY,0CAAe"}
|
|
@@ -3,12 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var someString = _a.someString, stringFromSubgraph = _a.stringFromSubgraph;
|
|
11
|
-
return (react_1.default.createElement(react_1.default.Fragment, null, "".concat(someString).concat(stringFromSubgraph)));
|
|
12
|
-
};
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const src_1 = require("../../src");
|
|
8
|
+
const MainGraph_1 = __importDefault(require("./MainGraph"));
|
|
9
|
+
const InjectedComponent = ({ someString, stringFromSubgraph }) => (react_1.default.createElement(react_1.default.Fragment, null, `${someString}${stringFromSubgraph}`));
|
|
13
10
|
exports.default = (0, src_1.injectComponent)(InjectedComponent, MainGraph_1.default);
|
|
14
11
|
//# sourceMappingURL=InjectedComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InjectedComponent.js","sourceRoot":"","sources":["../../../test/fixtures/InjectedComponent.tsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"InjectedComponent.js","sourceRoot":"","sources":["../../../test/fixtures/InjectedComponent.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,mCAA4C;AAC5C,4DAAoC;AAOpC,MAAM,iBAAiB,GAAG,CAAC,EAAE,UAAU,EAAE,kBAAkB,EAA0B,EAAE,EAAE,CAAC,CACxF,8DACG,GAAG,UAAU,GAAG,kBAAkB,EAAE,CACpC,CACJ,CAAC;AAEF,kBAAe,IAAA,qBAAe,EAAC,iBAAiB,EAAE,mBAAS,CAAC,CAAC"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -23,38 +8,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
23
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
10
|
};
|
|
11
|
+
var LifecycleBoundGraph_1;
|
|
26
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
13
|
exports.LifecycleBoundGraph = void 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
_this.props = props;
|
|
14
|
+
const src_1 = require("../../src");
|
|
15
|
+
const LifecycleBound_1 = require("../../src/decorators/LifecycleBound");
|
|
16
|
+
let LifecycleBoundGraph = LifecycleBoundGraph_1 = class LifecycleBoundGraph extends src_1.ObjectGraph {
|
|
17
|
+
constructor(props) {
|
|
18
|
+
super(props);
|
|
19
|
+
this.props = props;
|
|
35
20
|
LifecycleBoundGraph_1.timesCreated++;
|
|
36
|
-
return _this;
|
|
37
21
|
}
|
|
38
|
-
|
|
39
|
-
LifecycleBoundGraph.prototype.computedFromProps = function () {
|
|
22
|
+
computedFromProps() {
|
|
40
23
|
return this.props.stringFromProps
|
|
41
|
-
?
|
|
24
|
+
? `A string passed via props: ${this.props.stringFromProps}`
|
|
42
25
|
: 'stringFromProps does not exist';
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return LifecycleBoundGraph;
|
|
58
|
-
}(src_1.ObjectGraph));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
LifecycleBoundGraph.timesCreated = 0;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, src_1.Provides)(),
|
|
31
|
+
__metadata("design:type", Function),
|
|
32
|
+
__metadata("design:paramtypes", []),
|
|
33
|
+
__metadata("design:returntype", String)
|
|
34
|
+
], LifecycleBoundGraph.prototype, "computedFromProps", null);
|
|
35
|
+
LifecycleBoundGraph = LifecycleBoundGraph_1 = __decorate([
|
|
36
|
+
(0, LifecycleBound_1.LifecycleBound)(),
|
|
37
|
+
(0, src_1.Graph)(),
|
|
38
|
+
__metadata("design:paramtypes", [Object])
|
|
39
|
+
], LifecycleBoundGraph);
|
|
59
40
|
exports.LifecycleBoundGraph = LifecycleBoundGraph;
|
|
60
41
|
//# sourceMappingURL=LifecycleBoundGraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LifecycleBoundGraph.js","sourceRoot":"","sources":["../../../test/fixtures/LifecycleBoundGraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LifecycleBoundGraph.js","sourceRoot":"","sources":["../../../test/fixtures/LifecycleBoundGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAAyD;AACzD,wEAAqE;AAK9D,IAAM,mBAAmB,2BAAzB,MAAM,mBAA4B,SAAQ,iBAAsB;IAIrE,YAAY,KAAgB;QAC1B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,qBAAmB,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAGD,iBAAiB;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe;YAC/B,CAAC,CAAC,8BAA8B,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;YAC5D,CAAC,CAAC,gCAAgC,CAAC;IACvC,CAAC;;AAdM,gCAAY,GAAG,CAAC,CAAC;AASxB;IAAC,IAAA,cAAQ,GAAE;;;;4DAKV;AAfU,mBAAmB;IAD/B,IAAA,+BAAc,GAAE;IAAE,IAAA,WAAK,GAAE;;GACb,mBAAmB,CAgB/B;AAhBY,kDAAmB"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -27,37 +12,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
13
|
};
|
|
29
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
function MainGraph() {
|
|
37
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
38
|
-
}
|
|
39
|
-
MainGraph.prototype.someString = function (stringProvider) {
|
|
15
|
+
const src_1 = require("../../src");
|
|
16
|
+
const injectedValues_1 = __importDefault(require("./injectedValues"));
|
|
17
|
+
const StringProvider_1 = __importDefault(require("./StringProvider"));
|
|
18
|
+
const Subgraph_1 = __importDefault(require("./Subgraph"));
|
|
19
|
+
let MainGraph = class MainGraph extends src_1.ObjectGraph {
|
|
20
|
+
someString(stringProvider) {
|
|
40
21
|
return stringProvider.theString;
|
|
41
|
-
}
|
|
42
|
-
|
|
22
|
+
}
|
|
23
|
+
anotherString() {
|
|
43
24
|
return injectedValues_1.default.anotherString;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}(src_1.ObjectGraph));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, src_1.Provides)(),
|
|
29
|
+
__metadata("design:type", Function),
|
|
30
|
+
__metadata("design:paramtypes", [StringProvider_1.default]),
|
|
31
|
+
__metadata("design:returntype", String)
|
|
32
|
+
], MainGraph.prototype, "someString", null);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, src_1.Provides)(),
|
|
35
|
+
__metadata("design:type", Function),
|
|
36
|
+
__metadata("design:paramtypes", []),
|
|
37
|
+
__metadata("design:returntype", String)
|
|
38
|
+
], MainGraph.prototype, "anotherString", null);
|
|
39
|
+
MainGraph = __decorate([
|
|
40
|
+
(0, src_1.Graph)({ subgraphs: [Subgraph_1.default] })
|
|
41
|
+
], MainGraph);
|
|
62
42
|
exports.default = MainGraph;
|
|
63
43
|
//# sourceMappingURL=MainGraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainGraph.js","sourceRoot":"","sources":["../../../test/fixtures/MainGraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MainGraph.js","sourceRoot":"","sources":["../../../test/fixtures/MainGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mCAKmB;AACnB,sEAA8C;AAC9C,sEAA8C;AAC9C,0DAAkC;AAKnB,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,iBAAW;IAEhD,UAAU,CAAC,cAA8B;QACvC,OAAO,cAAc,CAAC,SAAS,CAAC;IAClC,CAAC;IAGD,aAAa;QACX,OAAO,wBAAc,CAAC,aAAa,CAAC;IACtC,CAAC;CACF,CAAA;AATC;IAAC,IAAA,cAAQ,GAAE;;qCACgB,wBAAc;;2CAExC;AAED;IAAC,IAAA,cAAQ,GAAE;;;;8CAGV;AATkB,SAAS;IAD7B,IAAA,WAAK,EAAC,EAAE,SAAS,EAAE,CAAC,kBAAQ,CAAC,EAAE,CAAC;GACZ,SAAS,CAU7B;kBAVoB,SAAS"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -24,30 +9,27 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
24
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
10
|
};
|
|
26
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
_this.id = (0, lodash_1.uniqueId)();
|
|
35
|
-
return _this;
|
|
12
|
+
const lodash_1 = require("lodash");
|
|
13
|
+
const Singleton_1 = require("../../src/decorators/Singleton");
|
|
14
|
+
const src_1 = require("../../src");
|
|
15
|
+
let SingletonGraph = class SingletonGraph extends src_1.ObjectGraph {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.id = (0, lodash_1.uniqueId)();
|
|
36
19
|
}
|
|
37
|
-
|
|
38
|
-
return
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}(src_1.ObjectGraph));
|
|
20
|
+
instanceId() {
|
|
21
|
+
return `graph${this.id}`;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, src_1.Provides)(),
|
|
26
|
+
__metadata("design:type", Function),
|
|
27
|
+
__metadata("design:paramtypes", []),
|
|
28
|
+
__metadata("design:returntype", String)
|
|
29
|
+
], SingletonGraph.prototype, "instanceId", null);
|
|
30
|
+
SingletonGraph = __decorate([
|
|
31
|
+
(0, Singleton_1.Singleton)(),
|
|
32
|
+
(0, src_1.Graph)()
|
|
33
|
+
], SingletonGraph);
|
|
52
34
|
exports.default = SingletonGraph;
|
|
53
35
|
//# sourceMappingURL=SingletonGraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingletonGraph.js","sourceRoot":"","sources":["../../../test/fixtures/SingletonGraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SingletonGraph.js","sourceRoot":"","sources":["../../../test/fixtures/SingletonGraph.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAkC;AAClC,8DAA2D;AAC3D,mCAAyD;AAG1C,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,iBAAW;IAAxC;;QACL,OAAE,GAAG,IAAA,iBAAQ,GAAE,CAAC;IAM1B,CAAC;IAHC,UAAU;QACR,OAAO,QAAQ,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3B,CAAC;CACF,CAAA;AAJC;IAAC,IAAA,cAAQ,GAAE;;;;gDAGV;AANkB,cAAc;IADlC,IAAA,qBAAS,GAAE;IAAE,IAAA,WAAK,GAAE;GACA,cAAc,CAOlC;kBAPoB,cAAc"}
|