{"map":"{\"version\":3,\"file\":\"_nextOperator.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/operators/foundation/_nextOperator.ts\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAmBnC,MAAM,2BAAoE,UAAa;IACrF,MAAM,CAAC,KAAM,SAAQ,UAAU;QAC7B;;;;;;;;WAQG;QACH,aAAa,CAAI,EAAE,SAAS,EAA2B;YACrD,MAAM,CAAC,IAAI,gBAAgB,CACzB,CAAC,QAAqB;gBACpB,MAAM,cAAc,GAAG,SAAS,CAAC;oBAC/B,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;iBACnC,CAAC,CAAC;gBAEH,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CACjC,CAAC,KAAQ,KAAK,cAAc,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAClD,CAAC;gBAEF,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC;YAClC,CAAC,CACF,CAAC;QACJ,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\nimport { MotionObservable, } from '../../observables/proxies';\r\nexport function withNextOperator(superclass) {\r\n    return class extends superclass {\r\n        /**\r\n         * `_nextOperator` is sugar for creating an operator that reads and writes\r\n         * from the `next` channel.  It encapsulates the stream creation and\r\n         * subscription boilerplate required for most operators.\r\n         *\r\n         * Its argument `operation` should receive a value from the parent stream's\r\n         * `next` channel, transform it, and use the supplied callback to emit the\r\n         * result to the observer's `next` channel.\r\n         */\r\n        _nextOperator({ operation }) {\r\n            return new MotionObservable((observer) => {\r\n                const innerOperation = operation({\r\n                    emit: observer.next.bind(observer),\r\n                });\r\n                const subscription = this.subscribe((value) => innerOperation({ upstream: value }));\r\n                return subscription.unsubscribe;\r\n            });\r\n        }\r\n    };\r\n}\r\n//# sourceMappingURL=_nextOperator.js.map","dts":{"name":"/Users/brentons/Projects/material-motion-js/packages/core/operators/foundation/_nextOperator.d.ts","text":"import { Constructor, EmittingOperation, Observable, ObservableWithMotionOperators } from '../../types';\r\nexport declare type _NextOperatorArgs<T, U> = {\r\n    operation: EmittingOperation<T, {}, U>;\r\n};\r\nexport interface MotionNextOperable<T> extends Observable<T> {\r\n    _nextOperator<U>(kwargs: _NextOperatorArgs<T, U>): ObservableWithMotionOperators<U>;\r\n}\r\nexport declare function withNextOperator<T, S extends Constructor<Observable<T>>>(superclass: S): S & Constructor<MotionNextOperable<T>>;\r\n"}}
