Comparing version 3.2.2 to 3.2.3
{ | ||
"name": "cordis", | ||
"description": "AOP Framework for Modern JavaScript Applications", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"sideEffects": false, | ||
@@ -6,0 +6,0 @@ "main": "lib/index.cjs", |
@@ -487,3 +487,3 @@ # Cordis | ||
// return a dispose function | ||
return this.caller.collect('list-item', () => { | ||
return this[Context.current].collect('list-item', () => { | ||
return this.removeItem(item) | ||
@@ -510,3 +510,3 @@ }) | ||
In the above example, `addItem` is implemented as disposable via `this.caller.collect()`. `caller` is a special property which always points to the last context which access the service. `ctx.collect()` accepts two parameters: the first is the name of disposable, the second is the callback function. | ||
In the above example, `addItem` is implemented as disposable via `this[Context.current].collect()`. `caller` is a special property which always points to the last context which access the service. `ctx.collect()` accepts two parameters: the first is the name of disposable, the second is the callback function. | ||
@@ -513,0 +513,0 @@ #### Service isolation [↑](#contents) |
@@ -185,3 +185,4 @@ import { defineProperty, Dict, isNullable } from 'cosmokit' | ||
if (!constructor) continue | ||
self[key] = new constructor(self, config) | ||
self[internal[key]['key']] = new constructor(self, config) | ||
self[internal[key]['key']][Context.source] = self | ||
} | ||
@@ -188,0 +189,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
177794
2948