Coder Social home page Coder Social logo

rxjs-in-action's Introduction

rxjs-in-action

Code sample repository

Install

First download/fork/clone the project

To start the server run (in the rxjs-in-action directory):

npm install && npm install -g gulp && gulp

On subsequent runs (if all goes well) you can run just

gulp

Adding new Examples (FROZEN)

Add new examples under the /examples directory. Each example should be organized under the sub-directory corresponding to its chapter and index.

i.e. Listing 2.3 => /examples/2/3

Each example can have three separate files, they should be labeled using the chapter and index

2_3.js 2_3.html 2_3.css

Currently you must also add a new selector option to the front-end as well. Go into index.html and add:

<option value="2.3">2.3</option>

This will allow the new sample to get picked up by the front end.

Bug reports

If you find a bug or an issue with one of the code samples please file an issue so that we can get it fixed for other readers

rxjs-in-action's People

Contributors

paulpdaniels avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rxjs-in-action's Issues

Rx.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)

I am new to the angular and rxjs.
I get the following runtime error in chrome:

Rx.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)

1 Refused to execute script from 'https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

Uncaught ReferenceError: Rx is not defined at wrapper ((index):43) at (index):73 wrapper @ (index):43 (anonymous) @ (index):73

I getting this errors in the build process

After downloading the git repo and run npm install && npm install -g gulp && gulp

'rxjs' is imported by app/js/utils/cookies.js, but could not be resolved – treating it as an external dependency
'rxjs' is imported by app/js/editors.js, but could not be resolved – treating it as an external dependency
'jquery' is imported by app/js/editors.js, but could not be resolved – treating it as an external dependency
'codemirror' is imported by app/js/editors.js, but could not be resolved – treating it as an external dependency
'jquery' is imported by app/js/runtime.js, but could not be resolved – treating it as an external dependency

The next error, it fixed after update the gulpfile

The sourceMap option has been renamed to "sourcemap" (lowercase "m") in Rollup. The old form is now deprecated in rollup-stream. options.entry is deprecated, use options.input

  return rollup({
    input: './app/js/runtime.js',
    sourcemap: true,

Listing 4.7 code doesn't match associated marble diagram

https://github.com/RxJSInAction/rxjs-in-action/blob/master/examples/4/7/4_7.js

does not correspond to the marble diagram (p.99, Figure 4.8) of 4.3.1 Propagation. Due to the use of the of static operator there is only a single event containing an array of five elements - not five events as depicted in the marble diagram. For that the from static operator has to be used:

const showEmitted = x => console.log(`Emitted: ${x}`);
const showReceived = x => console.log(`Received: ${x}`);

Rx.Observable.from([1, 2, 3, 4, 5])
  .do(showEmitted)
  .delay(200)
  .subscribe(showReceived);

// Output:
// Emitted: 1
// Emitted: 2
// Emitted: 3
// Emitted: 4
// Emitted: 5
// ... 200 milliseconds later...
// Received: 1
// Received: 2
// Received: 3
// Received: 4
// Received: 5

5.7 & 5.8 - Drag-and-drop stream logic

The index.html file in app references value 5.8 but the folder structure is examples > 5 > 7. Updating the value to 5.7 loads the drag-and-drop code as expected.

It prints USDMoney object instead of its amount

Hi!
You need to invoke toString() method on a newly created USDMoney object on line 28. Because now it's printing the object and I guess you want to more valuable output.
The same case in the next listing (4_5.js).

Or is it tricky don't_copypaste_blindly game for readers?🙂

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.