UNPKG

mmlpx

Version:

mobx model layer paradigm

18 lines (17 loc) 701 B
import _isString from 'lodash/isString'; /** * @author Kuitos * @homepage https://github.com/kuitos/ * @since 2017-07-12 */ import { v4 } from 'uuid'; import namedModelDecorator from '../../../utils/namedModelDecorator'; import { storeSymbol } from '../meta'; export default (function (arg1) { // if decorator named // eg. @Store('xStore') class Store {} if (_isString(arg1)) { return namedModelDecorator(arg1, storeSymbol); } var name = v4(); return namedModelDecorator(name, storeSymbol)(arg1); });