import r from"@babel/runtime/helpers/slicedToArray";import{useState as e,useEffect as o}from"react";import{fromPairs as t}from"lodash";import n from"fparser";var a=function(a,l){var m=e(null),u=r(m,2),i=u[0],f=u[1],p=e(""),c=r(p,2),s=c[0],h=c[1];return o((function(){if(a&&l&&l.length)try{var r=new n(a),e=[];e.push(t(l.map((function(r){return[r,Math.random()]})))),r.evaluate(e),f(r),h("")}catch(r){f(null),h(r.message)}else f(null),h("")}),[a,l]),{formulaFunction:i,error:s}};export{a as useFormulaFunction};
//# sourceMappingURL=useFormulaFunction.js.map
