react-obsidian
Version:
Dependency injection framework for React and React Native applications
13 lines (12 loc) • 433 B
text/typescript
import { Constructable } from '../../types';
import { ObjectGraph } from '../../graph/ObjectGraph';
import {Reflect} from '../../utils/reflect';
export function legacyDecorator(
constructorOrGraph: Constructable<ObjectGraph> | ObjectGraph,
_property?: string,
descriptor?: PropertyDescriptor,
): any {
const target = descriptor || constructorOrGraph;
Reflect.defineMetadata('isSingleton', true, target);
return target;
}