Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
Run RxJs with unpkg.com CDN

I am want to run RxJs code snippets in a single HTML file. The below example runs

<!DOCTYPE html>
<!--
Created using JS Bin
http://jsbin.com

Copyright (c) 2022 by anonymous (http://jsbin.com/gemebopifu/1/edit)

Released under the MIT license: http://jsbin.mit-license.org
-->
<meta name="robots" content="noindex" />
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width" />
        <title>RxJS 5 Operators</title>
        <script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.3/dist/global/Rx.umd.js"></script>
    </head>
    <body>
        <script id="jsbin-javascript">
            //emit value every 1s
            const source = Rx.Observable.interval(1000);
            //sample last emitted value from source every 2s
            const example = source.sample(Rx.Observable.interval(2000));
            //output: 2..4..6..8..
            const subscribe = example.subscribe((val) => console.log(val));
        </script>
    </body>
</html>

However, if I replace it with the unpkg CDN (), it does not work

https://unpkg.com/browse/rxjs@7.5.4/dist/bundles/rxjs.umd.js

So clearly I can't replace directly.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

For unpkg it should be: https://unpkg.com/rxjs@7.5.5/dist/bundles/rxjs.umd.js

Here's the working solution:

<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>RxJS 5 Operators</title>
    <script src="https://unpkg.com/rxjs@7.5.5/dist/bundles/rxjs.umd.js"></script>
</head>
<body>
    <script id="jsbin-javascript">
        //emit value every 1s
        const source = window.rxjs.interval(1000);
        //sample last emitted value from source every 2s
        const example = window.rxjs.interval(2000);
        //output: 2..4..6..8..
        const subscribe = example.subscribe((val) => console.log(val));
    </script>
</body>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!