{"map":"{\"version\":3,\"file\":\"_reactiveMap.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/operators/foundation/_reactiveMap.ts\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;;GAcG;AAwBH,MAAM,0BAAuG,UAAa;IACxH,MAAM,CAAC,KAAM,SAAQ,UAAU;QAC7B;;;;;;;WAOG;QACH,YAAY,CAAO,EAAE,SAAS,EAAE,MAAM,EAAE,oBAAoB,GAAG,KAAK,EAA6B;YAC/F,IAAI,eAAe,GAAG,KAAK,CAAC;YAE5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;gBACf,UAAU;oBACR,eAAe,GAAG,IAAI,CAAC;gBACzB,CAAC;aACF,CAAC,CAAC,qBAAqB,CAAO;gBAC7B,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM;oBAC9B,EAAE,CAAC,CAAC,eAAe,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;wBAC7C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1B,CAAC;oBACD,eAAe,GAAG,KAAK,CAAC;gBAC1B,CAAC;gBACD,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,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\nexport function withReactiveMap(superclass) {\r\n    return class extends superclass {\r\n        /**\r\n         * Whenever the upstream value or an argument's value changes,\r\n         * `_reactiveMap` calls `transform` and synchronously passes the result to\r\n         * the observer.\r\n         *\r\n         * If the `onlyEmitWithUpstream` option is set, `transform` is only\r\n         * called when the upstream value changes.\r\n         */\r\n        _reactiveMap({ transform, inputs, onlyEmitWithUpstream = false }) {\r\n            let upstreamChanged = false;\r\n            return this._tap({\r\n                sideEffect() {\r\n                    upstreamChanged = true;\r\n                },\r\n            })._reactiveNextOperator({\r\n                operation: ({ emit }) => (values) => {\r\n                    if (upstreamChanged || !onlyEmitWithUpstream) {\r\n                        emit(transform(values));\r\n                    }\r\n                    upstreamChanged = false;\r\n                },\r\n                inputs\r\n            });\r\n        }\r\n    };\r\n}\r\n//# sourceMappingURL=_reactiveMap.js.map","dts":{"name":"/Users/brentons/Projects/material-motion-js/packages/core/operators/foundation/_reactiveMap.d.ts","text":"/** @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 { Constructor, MaybeReactive, MotionReactiveNextOperable, MotionTappable, ObservableWithMotionOperators } from '../../types';\r\nexport declare type _ReactiveMapOptions = Partial<{\r\n    onlyEmitWithUpstream: boolean;\r\n}>;\r\nexport declare type _ReactiveMapArgs<T, D, U> = _ReactiveMapOptions & {\r\n    transform: (kwargs: {\r\n        upstream: T;\r\n    } & D) => U;\r\n    inputs: MaybeReactive<D>;\r\n};\r\nexport interface MotionReactiveMappable<T> {\r\n    _reactiveMap<U, D>(kwargs: _ReactiveMapArgs<T, D, U>): ObservableWithMotionOperators<U>;\r\n}\r\nexport declare function withReactiveMap<T, S extends Constructor<MotionReactiveNextOperable<T> & MotionTappable<T>>>(superclass: S): S & Constructor<MotionReactiveMappable<T>>;\r\n"}}
