1 line
No EOL
2.8 KiB
JSON
1 line
No EOL
2.8 KiB
JSON
{"ast":null,"code":"import { Observable } from '../Observable';\nimport { from } from './from';\nimport { EMPTY } from './empty';\nexport function using(resourceFactory, observableFactory) {\n return new Observable(subscriber => {\n let resource;\n try {\n resource = resourceFactory();\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n let result;\n try {\n result = observableFactory(resource);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n const source = result ? from(result) : EMPTY;\n const subscription = source.subscribe(subscriber);\n return () => {\n subscription.unsubscribe();\n if (resource) {\n resource.unsubscribe();\n }\n };\n });\n}","map":{"version":3,"names":["Observable","from","EMPTY","using","resourceFactory","observableFactory","subscriber","resource","err","error","undefined","result","source","subscription","subscribe","unsubscribe"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/observable/using.js"],"sourcesContent":["import { Observable } from '../Observable';\nimport { from } from './from';\nimport { EMPTY } from './empty';\nexport function using(resourceFactory, observableFactory) {\n return new Observable(subscriber => {\n let resource;\n try {\n resource = resourceFactory();\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n let result;\n try {\n result = observableFactory(resource);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n const source = result ? from(result) : EMPTY;\n const subscription = source.subscribe(subscriber);\n return () => {\n subscription.unsubscribe();\n if (resource) {\n resource.unsubscribe();\n }\n };\n });\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,eAAe;AAC1C,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,KAAK,QAAQ,SAAS;AAC/B,OAAO,SAASC,KAAKA,CAACC,eAAe,EAAEC,iBAAiB,EAAE;EACtD,OAAO,IAAIL,UAAU,CAACM,UAAU,IAAI;IAChC,IAAIC,QAAQ;IACZ,IAAI;MACAA,QAAQ,GAAGH,eAAe,CAAC,CAAC;IAChC,CAAC,CACD,OAAOI,GAAG,EAAE;MACRF,UAAU,CAACG,KAAK,CAACD,GAAG,CAAC;MACrB,OAAOE,SAAS;IACpB;IACA,IAAIC,MAAM;IACV,IAAI;MACAA,MAAM,GAAGN,iBAAiB,CAACE,QAAQ,CAAC;IACxC,CAAC,CACD,OAAOC,GAAG,EAAE;MACRF,UAAU,CAACG,KAAK,CAACD,GAAG,CAAC;MACrB,OAAOE,SAAS;IACpB;IACA,MAAME,MAAM,GAAGD,MAAM,GAAGV,IAAI,CAACU,MAAM,CAAC,GAAGT,KAAK;IAC5C,MAAMW,YAAY,GAAGD,MAAM,CAACE,SAAS,CAACR,UAAU,CAAC;IACjD,OAAO,MAAM;MACTO,YAAY,CAACE,WAAW,CAAC,CAAC;MAC1B,IAAIR,QAAQ,EAAE;QACVA,QAAQ,CAACQ,WAAW,CAAC,CAAC;MAC1B;IACJ,CAAC;EACL,CAAC,CAAC;AACN","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]} |