You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description": "<html><head></head><body><p>A container used to instantiate and cache objects.</p>\n<p>Every <code>Container</code> must be associated with a <code>Registry</code>, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.</p>\n<p>The public API for <code>Container</code> is still in flux and should not be considered\nstable.</p>\n</body></html>",
17
+
"access": "private",
18
+
"tagname": "",
19
+
"methods": [
20
+
{
21
+
"file": "packages/container/lib/container.js",
22
+
"line": 68,
23
+
"description": "<html><head></head><body><p>Given a fullName return a corresponding instance.</p>\n<p>The default behaviour is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.</p>\n<div class=\"highlight javascript\">\n <div class=\"ribbon\"></div>\n <div class=\"scroller\">\n <table class=\"CodeRay\">\n <tbody>\n <tr>\n <td class=\"line-numbers\"><pre>1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n</pre></td>\n <td class=\"code\"><pre><span class=\"keyword\">let</span> registry = <span class=\"keyword\">new</span> Registry();\n<span class=\"keyword\">let</span> container = registry.container();\n\nregistry.register(<span class=\"string\">'api:twitter'</span>, Twitter);\n\n<span class=\"keyword\">let</span> twitter = container.lookup(<span class=\"string\">'api:twitter'</span>);\n\ntwitter <span class=\"keyword\">instanceof</span> Twitter; <span class=\"comment\">// => true</span>\n\n<span class=\"comment\">// by default the container will return singletons</span>\n<span class=\"keyword\">let</span> twitter2 = container.lookup(<span class=\"string\">'api:twitter'</span>);\ntwitter2 <span class=\"keyword\">instanceof</span> Twitter; <span class=\"comment\">// => true</span>\n\ntwitter === twitter2; <span class=\"comment\">//=> true</span></pre></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n \n<p>If singletons are not wanted, an optional flag can be provided at lookup.</p>\n<div class=\"highlight javascript\">\n <div class=\"ribbon\"></div>\n <div class=\"scroller\">\n <table class=\"CodeRay\">\n <tbody>\n <tr>\n <td class=\"line-numbers\"><pre>1\n2\n3\n4\n5\n6\n7\n8\n9\n</pre></td>\n <td class=\"code\"><pre><span class=\"keyword\">let</span> <span class=\"attr\">registry</span> = new Registry();\n<span class=\"keyword\">let</span> <span class=\"attr\">container</span> = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\n<span class=\"keyword\">let</span> <span class=\"attr\">twitter</span> = container.lookup('api:twitter', { singleton: <span class=\"literal\">false</span> });\n<span class=\"keyword\">let</span> <span class=\"attr\">twitter2</span> = container.lookup('api:twitter', { singleton: <span class=\"literal\">false</span> });\n\n<span class=\"attr\">twitter</span> === twitter2; //=> <span class=\"literal\">false</span></pre></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n \n</body></html>",
24
+
"access": "private",
25
+
"tagname": "",
26
+
"itemtype": "method",
27
+
"name": "lookup",
28
+
"params": [
29
+
{
30
+
"name": "fullName",
31
+
"description": "",
32
+
"type": "String"
33
+
},
34
+
{
35
+
"name": "options",
36
+
"description": "",
37
+
"type": "Object",
38
+
"optional": true,
39
+
"props": [
40
+
{
41
+
"name": "source",
42
+
"description": "The fullname of the request source (used for local lookup)",
43
+
"type": "String",
44
+
"optional": true
45
+
}
46
+
]
47
+
}
48
+
],
49
+
"return": {
50
+
"description": "",
51
+
"type": "Any"
52
+
},
53
+
"class": "Container"
54
+
},
55
+
{
56
+
"file": "packages/container/lib/container.js",
57
+
"line": 118,
58
+
"description": "<html><head></head><body><p>Given a fullName, return the corresponding factory.</p>\n</body></html>",
59
+
"access": "private",
60
+
"tagname": "",
61
+
"itemtype": "method",
62
+
"name": "lookupFactory",
63
+
"params": [
64
+
{
65
+
"name": "fullName",
66
+
"description": "",
67
+
"type": "String"
68
+
},
69
+
{
70
+
"name": "options",
71
+
"description": "",
72
+
"type": "Object",
73
+
"optional": true,
74
+
"props": [
75
+
{
76
+
"name": "source",
77
+
"description": "The fullname of the request source (used for local lookup)",
78
+
"type": "String",
79
+
"optional": true
80
+
}
81
+
]
82
+
}
83
+
],
84
+
"return": {
85
+
"description": "",
86
+
"type": "Any"
87
+
},
88
+
"class": "Container"
89
+
},
90
+
{
91
+
"file": "packages/container/lib/container.js",
92
+
"line": 133,
93
+
"description": "<html><head></head><body><p>A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.</p>\n</body></html>",
94
+
"access": "private",
95
+
"tagname": "",
96
+
"itemtype": "method",
97
+
"name": "destroy",
98
+
"class": "Container"
99
+
},
100
+
{
101
+
"file": "packages/container/lib/container.js",
102
+
"line": 150,
103
+
"description": "<html><head></head><body><p>Clear either the entire cache or just the cache for a particular key.</p>\n</body></html>",
104
+
"access": "private",
105
+
"tagname": "",
106
+
"itemtype": "method",
107
+
"name": "reset",
108
+
"params": [
109
+
{
110
+
"name": "fullName",
111
+
"description": "optional key to reset; if missing, resets everything",
112
+
"type": "String"
113
+
}
114
+
],
115
+
"class": "Container"
116
+
},
117
+
{
118
+
"file": "packages/container/lib/container.js",
119
+
"line": 165,
120
+
"description": "<html><head></head><body><p>Returns an object that can be used to provide an owner to a\nmanually created instance.</p>\n</body></html>",
"description": "<html><head></head><body><p>ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.</p>\n</body></html>",
0 commit comments