Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

252
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda