UNPKG

@mic-rexjs/usecases-react

Version:

React-based solution for use usecases of Clean Architecture

14 lines 524 B
import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; import { ArgumentTypes } from '../../enums/ArgumentTypes'; export const useFullArguments = (args, argumentTypes) => { const _args = _slicedToArray(args, 4), arg1 = _args[0], arg2 = _args[1], arg3 = _args[2], arg4 = _args[3]; const withoutEntity = (argumentTypes & ArgumentTypes.Entity) !== ArgumentTypes.Entity; if (withoutEntity) { return [null, arg1, arg2 || {}, arg3 || []]; } return [arg1, arg2, arg3 || {}, arg4 || []]; };