ayanami
Version:
A better way to react with state
14 lines (13 loc) • 599 B
JavaScript
export var SameScopeMetadataKey = Symbol('SameScopeInjectionParams');
export var SameScope = function () { return function (
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
target, _propertyKey, parameterIndex) {
var sameScopeInjectionParams = [];
if (Reflect.hasMetadata(SameScopeMetadataKey, target)) {
sameScopeInjectionParams = Reflect.getMetadata(SameScopeMetadataKey, target);
}
else {
Reflect.defineMetadata(SameScopeMetadataKey, sameScopeInjectionParams, target);
}
sameScopeInjectionParams[parameterIndex] = true;
}; };