40d77ef6ef1121f96085565910652980.json
2.65 KB
{"ast":null,"code":"import raf from \"rc-util/es/raf\";\nvar id = 0;\nvar ids = {}; // Support call raf with delay specified frame\n\nexport default function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = raf(internalCallback);\n }\n }\n\n ids[myId] = raf(internalCallback);\n return myId;\n}\n\nwrapperRaf.cancel = function cancel(pid) {\n if (pid === undefined) return;\n raf.cancel(ids[pid]);\n delete ids[pid];\n};\n\nwrapperRaf.ids = ids; // export this for test usage","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/_util/raf.js"],"names":["raf","id","ids","wrapperRaf","callback","delayFrames","arguments","length","undefined","myId","restFrames","internalCallback","cancel","pid"],"mappings":"AAAA,OAAOA,GAAP,MAAgB,gBAAhB;AACA,IAAIC,EAAE,GAAG,CAAT;AACA,IAAIC,GAAG,GAAG,EAAV,C,CAAc;;AAEd,eAAe,SAASC,UAAT,CAAoBC,QAApB,EAA8B;AAC3C,MAAIC,WAAW,GAAGC,SAAS,CAACC,MAAV,GAAmB,CAAnB,IAAwBD,SAAS,CAAC,CAAD,CAAT,KAAiBE,SAAzC,GAAqDF,SAAS,CAAC,CAAD,CAA9D,GAAoE,CAAtF;AACA,MAAIG,IAAI,GAAGR,EAAE,EAAb;AACA,MAAIS,UAAU,GAAGL,WAAjB;;AAEA,WAASM,gBAAT,GAA4B;AAC1BD,IAAAA,UAAU,IAAI,CAAd;;AAEA,QAAIA,UAAU,IAAI,CAAlB,EAAqB;AACnBN,MAAAA,QAAQ;AACR,aAAOF,GAAG,CAACO,IAAD,CAAV;AACD,KAHD,MAGO;AACLP,MAAAA,GAAG,CAACO,IAAD,CAAH,GAAYT,GAAG,CAACW,gBAAD,CAAf;AACD;AACF;;AAEDT,EAAAA,GAAG,CAACO,IAAD,CAAH,GAAYT,GAAG,CAACW,gBAAD,CAAf;AACA,SAAOF,IAAP;AACD;;AAEDN,UAAU,CAACS,MAAX,GAAoB,SAASA,MAAT,CAAgBC,GAAhB,EAAqB;AACvC,MAAIA,GAAG,KAAKL,SAAZ,EAAuB;AACvBR,EAAAA,GAAG,CAACY,MAAJ,CAAWV,GAAG,CAACW,GAAD,CAAd;AACA,SAAOX,GAAG,CAACW,GAAD,CAAV;AACD,CAJD;;AAMAV,UAAU,CAACD,GAAX,GAAiBA,GAAjB,C,CAAsB","sourcesContent":["import raf from \"rc-util/es/raf\";\nvar id = 0;\nvar ids = {}; // Support call raf with delay specified frame\n\nexport default function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = raf(internalCallback);\n }\n }\n\n ids[myId] = raf(internalCallback);\n return myId;\n}\n\nwrapperRaf.cancel = function cancel(pid) {\n if (pid === undefined) return;\n raf.cancel(ids[pid]);\n delete ids[pid];\n};\n\nwrapperRaf.ids = ids; // export this for test usage"]},"metadata":{},"sourceType":"module"}