UNPKG

ramda-extension

Version:

Helpful functions built on top of the mighty Ramda

26 lines (23 loc) 524 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ramda = require("ramda"); /** * Returns a function that creates new instances of whatever argument * is passed in each time it's called. * * @func * @private * @example * * const alwaysNewArray = alwaysNew([]); * const a = alwaysNewArray(); * const b = alwaysNewArray(); * // a !== b * */ var alwaysNew = (0, _ramda.thunkify)(_ramda.clone); var _default = alwaysNew; exports.default = _default;