{"map":"{\"version\":3,\"file\":\"subscribe.js\",\"sourceRoot\":\"\",\"sources\":[\"../../src/subscribe.ts\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;;GAcG;AAyCH,MAAM,oBAAuB,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAqD;IACrG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACT,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAEhC,CAAC;IAAC,IAAI,CAAC,CAAC;QACN,MAAM,CAAC,KAAK,CAAC,GAAG,CACd,CAAC,IAAiB,KAAK,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAC9C,CAAC;IACJ,CAAC;AACH,CAAC;AACD,eAAe,SAAS,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 subscribe({ sink, sinks, source }) {\r\n    if (sink) {\r\n        return source.subscribe(sink);\r\n    }\r\n    else {\r\n        return sinks.map((sink) => source.subscribe(sink));\r\n    }\r\n}\r\nexport default subscribe;\r\n//# sourceMappingURL=subscribe.js.map","dts":{"name":"/Users/brentons/Projects/material-motion-js/packages/core/subscribe.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 { Observable, Observer, Subscription } from './types';\r\nexport declare type SubscribeArgsSingular<T> = {\r\n    sink: Observer<T>;\r\n    source: Observable<T>;\r\n};\r\nexport declare type SubscribeArgsPlural<T> = {\r\n    sinks: Array<Observer<T>>;\r\n    source: Observable<T>;\r\n};\r\n/**\r\n * `subscribe({ sink, source })` is sugar for `source.subscribe(sink)`.\r\n *\r\n * When programming, you generally declare a variable in terms of an expression:\r\n *\r\n *     const result = 1 + 2 + 3;\r\n *\r\n * You declare the output you are affecting and then the expression that defines\r\n * it.  Observables typically invert this flow:\r\n *\r\n *     `1$.addedBy(2).addedBy(3).subscribe(result$);`\r\n *\r\n * `subscribe({ sink, source: input$ })` corrects this, making declarations\r\n * easier to read by identifying the output before the expression that writes to\r\n * it:\r\n *\r\n *     subscribe({\r\n *       sink: result$,\r\n *       source: 1$.addedBy(2).addedBy(3)\r\n *     });\r\n */\r\nexport declare function subscribe<T>({sink, source}: SubscribeArgsSingular<T>): Subscription;\r\nexport declare function subscribe<T>({sinks, source}: SubscribeArgsPlural<T>): Array<Subscription>;\r\nexport default subscribe;\r\n"}}
