{"map":"{\"version\":3,\"file\":\"getFrame$.js\",\"sourceRoot\":\"\",\"sources\":[\"../../src/getFrame$.ts\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAO/B;;;;;;;;GAQG;AACH,IAAI,MAA6C,CAAC;AAClD,MAAM;IACJ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACZ,MAAM,GAAG,IAAI,gBAAgB,CAC3B,CAAC,QAA0B;YACzB,IAAI,aAAa,GAAG,CAAC,CAAC;YAEtB,oBAAoB,cAAuB;gBACzC,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;oBACnB,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gBAChC,CAAC;gBAED,aAAa,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;YACpD,CAAC;YAED,UAAU,EAAE,CAAC;YAEb,MAAM,CAAC;gBACL,oBAAoB,CAAC,aAAa,CAAC,CAAC;YACtC,CAAC,CAAC;QACJ,CAAC,CACF,CAAC,UAAU,EAAE,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC\"}","code":"/** @license\r\n *  Copyright 2016 - present The Material Motion Authors. All Rights Reserved.\r\n *\r\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n *  use this file except in compliance with the License. You may obtain a copy\r\n *  of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n *  Unless required by applicable law or agreed to in writing, software\r\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n *  License for the specific language governing permissions and limitations\r\n *  under the License.\r\n */\r\nimport { MotionObservable, } from './observables/proxies';\r\n/**\r\n * A stream backed by `requestAnimationFrame`, called once per frame with that\r\n * frame's timestamp.\r\n *\r\n * Useful as a pulse for `_debounce` to ensure that UI work only happens once\r\n * per frame.  Since no rendering will happen until `requestAnimationFrame` is\r\n * called, it should be safe to `_debounce({ pulse$: frame$ })` without missing\r\n * a frame.\r\n */\r\nlet frame$;\r\nexport function getFrame$() {\r\n    if (!frame$) {\r\n        frame$ = new MotionObservable((observer) => {\r\n            let queuedFrameID = 0;\r\n            function queueFrame(frameTimestamp) {\r\n                if (frameTimestamp) {\r\n                    observer.next(frameTimestamp);\r\n                }\r\n                queuedFrameID = requestAnimationFrame(queueFrame);\r\n            }\r\n            queueFrame();\r\n            return () => {\r\n                cancelAnimationFrame(queuedFrameID);\r\n            };\r\n        })._multicast();\r\n    }\r\n    return frame$;\r\n}\r\n//# sourceMappingURL=getFrame$.js.map","dts":{"name":"/Users/brentons/Projects/material-motion-js/packages/core/getFrame$.d.ts","text":"import { ObservableWithMotionOperators } from './types';\r\nexport declare function getFrame$(): ObservableWithMotionOperators<number>;\r\n"}}
