aprog 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -23,7 +23,7 @@ export {
23
23
  } from './src/html.js';
24
24
  export { prism } from "./src/prism.js";
25
25
  export { uniquePage } from "./src/pages.js";
26
- export { state, wrap, toast, abort, useTableDrag } from "./src/helper.js";
26
+ export { state, wrap, toast, abort, useTableDrag, callback } from "./src/helper.js";
27
27
  export { loadTranslations, translate } from "./src/translator.js";
28
28
  export { svg } from "./src/svg.js";
29
29
  export { Modal, modal, closeAllModals, closeThisModal } from "./src/modal.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aprog",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Допоміжна JavaScript-бібліотека для проєктів",
5
5
  "main": "index.js",
6
6
  "exports": {
package/src/helper.js CHANGED
@@ -105,3 +105,12 @@ export const useTableDrag = (selectorOrElement, onReorder = null, time = 1000) =
105
105
 
106
106
  return { getOrder };
107
107
  };
108
+
109
+ /**
110
+ * Creates a callback with predefined arguments.
111
+ *
112
+ * @param {Function} fn
113
+ * @param {...*} args
114
+ * @returns {Function}
115
+ */
116
+ export const callback = (fn, ...args) => (...extra) => fn(...args, ...extra);