dreamstate
Version:
Store management library based on react context and observers
18 lines (16 loc) • 523 B
JavaScript
// Todo: Wait for proper proposal decorators.
// Todo: Tests.
function createMethodDecorator(resolver) {
return function (prototypeOrDescriptor, method) {
if (prototypeOrDescriptor && method) {
resolver(method, prototypeOrDescriptor.constructor);
return prototypeOrDescriptor;
} else {
prototypeOrDescriptor.finisher = function (targetClass) {
resolver(prototypeOrDescriptor.key, targetClass);
};
return prototypeOrDescriptor;
}
};
}
export { createMethodDecorator };