@loona/react
Version:
App State Management done with GraphQL (react integration)
26 lines • 1.06 kB
JavaScript
export function decorate(thing, decorators) {
var target = typeof thing === 'function' ? thing.prototype : thing;
var _loop_1 = function (prop) {
var propertyDecorators = decorators[prop];
if (!Array.isArray(propertyDecorators)) {
propertyDecorators = [propertyDecorators];
}
var descriptor = Object.getOwnPropertyDescriptor(target, prop);
var newDescriptor = propertyDecorators.reduce(function (accDescriptor, decorator) {
return decorator(target, prop, accDescriptor);
}, descriptor);
if (newDescriptor)
Object.defineProperty(target, prop, newDescriptor);
};
for (var prop in decorators) {
_loop_1(prop);
}
return thing;
}
export function getDisplayName(component) {
return component.displayName || component.name || 'Component';
}
export function isMutationType(doc) {
return doc.definitions.some(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'mutation'; });
}
//# sourceMappingURL=utils.js.map