@o3r/core
Version:
Core of the Otter Framework
10 lines • 370 B
JavaScript
import { v4, } from 'uuid';
import { isAsyncRequest, } from './async.helpers';
/**
* Returns a creator that makes sure that requestId is defined in the action's properties by generating one
* if needed.
*/
export const asyncProps = () => {
return (props) => isAsyncRequest(props) ? props : { ...props, requestId: v4() };
};
//# sourceMappingURL=async.props.js.map