03a24963de752cc0e3010f711976b5e5.json
3.46 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.evaluateOnce=evaluateOnce;var _InternalAnimatedValue=_interopRequireDefault(require(\"../core/InternalAnimatedValue\"));var _AnimatedSet=require(\"../core/AnimatedSet\");var _AnimatedCall=require(\"../core/AnimatedCall\");var _AnimatedAlways=require(\"../core/AnimatedAlways\");var _AnimatedCond=require(\"../core/AnimatedCond\");function evaluateOnce(node){var input=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var callback=arguments.length>2?arguments[2]:undefined;if(!Array.isArray(input)){input=[input];}var done=new _InternalAnimatedValue.default(0);var evalNode=(0,_AnimatedCond.createAnimatedCond)(done,0,(0,_AnimatedCall.createAnimatedCall)([node,(0,_AnimatedSet.createAnimatedSet)(done,1)],function(){callback&&callback();for(var i=0;i<input.length;i++){input[i].__removeChild(alwaysNode);alwaysNode.__detach();}}));var alwaysNode=(0,_AnimatedAlways.createAnimatedAlways)(evalNode);for(var i=0;i<input.length;i++){input[i].__addChild(alwaysNode);alwaysNode.__attach();}}","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-reanimated/src/derived/evaluateOnce.js"],"names":["evaluateOnce","node","input","callback","Array","isArray","done","AnimatedValue","evalNode","i","length","__removeChild","alwaysNode","__detach","__addChild","__attach"],"mappings":"8KAAA,4FACA,gDACA,kDACA,sDACA,kDASO,QAASA,CAAAA,YAAT,CAAsBC,IAAtB,CAAkD,IAAtBC,CAAAA,KAAsB,2DAAd,EAAc,IAAVC,CAAAA,QAAU,2CACvD,GAAI,CAACC,KAAK,CAACC,OAAN,CAAcH,KAAd,CAAL,CAA2B,CACzBA,KAAK,CAAG,CAACA,KAAD,CAAR,CACD,CACD,GAAMI,CAAAA,IAAI,CAAG,GAAIC,+BAAJ,CAAkB,CAAlB,CAAb,CACA,GAAMC,CAAAA,QAAQ,CAAG,qCACfF,IADe,CAEf,CAFe,CAGf,qCAAK,CAACL,IAAD,CAAO,mCAAIK,IAAJ,CAAU,CAAV,CAAP,CAAL,CAA2B,UAAM,CAC/BH,QAAQ,EAAIA,QAAQ,EAApB,CACA,IAAK,GAAIM,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGP,KAAK,CAACQ,MAA1B,CAAkCD,CAAC,EAAnC,CAAuC,CACrCP,KAAK,CAACO,CAAD,CAAL,CAASE,aAAT,CAAuBC,UAAvB,EACAA,UAAU,CAACC,QAAX,GACD,CACF,CAND,CAHe,CAAjB,CAWA,GAAMD,CAAAA,UAAU,CAAG,yCAAOJ,QAAP,CAAnB,CACA,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGP,KAAK,CAACQ,MAA1B,CAAkCD,CAAC,EAAnC,CAAuC,CACrCP,KAAK,CAACO,CAAD,CAAL,CAASK,UAAT,CAAoBF,UAApB,EACAA,UAAU,CAACG,QAAX,GACD,CACF","sourcesContent":["import AnimatedValue from '../core/InternalAnimatedValue';\nimport { createAnimatedSet as set } from '../core/AnimatedSet';\nimport { createAnimatedCall as call } from '../core/AnimatedCall';\nimport { createAnimatedAlways as always } from '../core/AnimatedAlways';\nimport { createAnimatedCond as cond } from '../core/AnimatedCond';\n\n/**\n * evaluate given node and notify children\n * @param node - node to be evaluated\n * @param input - nodes (or one node) representing values which states input for node.\n * @param callback - after callback\n */\n\nexport function evaluateOnce(node, input = [], callback) {\n if (!Array.isArray(input)) {\n input = [input];\n }\n const done = new AnimatedValue(0);\n const evalNode = cond(\n done,\n 0,\n call([node, set(done, 1)], () => {\n callback && callback();\n for (let i = 0; i < input.length; i++) {\n input[i].__removeChild(alwaysNode);\n alwaysNode.__detach();\n }\n })\n );\n const alwaysNode = always(evalNode);\n for (let i = 0; i < input.length; i++) {\n input[i].__addChild(alwaysNode);\n alwaysNode.__attach();\n }\n}\n"]},"metadata":{},"sourceType":"script"}