Reactive programming with RxJS

RxJS is a set of APIs that unifies the way you interact with collections and events.
The main actors are Observables and Observers, but the full power of the library is the rich set of operators and schedulers that you can combine to achieve really complex data processing and orchestration in a very expressive and declarative way.

Observables push values to subscribers.

You can convert different data types to Observables.

There are a few shortcut operators to create common special Observables.

To stream values over time you can use schedulers.

Finally, you can unsubscribe from an Observable to stop recibing data.

That just scratches the surface of what can be achieved with Observables.
To find out more about RxJS check the RxJS github repo.

Cordova projects and npm modules

It may sound obvious but I did it wrong for a while…
When you create a Cordova (Phonegap) application and you want to use npm modules don’t add them within the www folder, use the Cordova project root instead, otherwise the generated node_modules folder will get compiled and added to your build.
The final project structure (as of Cordova 4.0) should look something like this:

|   \---hooks
|   \---node_modules
|   \---platforms
|   \---plugins
|   \---www
|   \---config.xml
|   \---package.json // npm project config file
|   \---gulpfile.js // Gulp config file
|   \---karma.conf.js // Karma test runner config file

The node_modules folder is safe here, it won’t be added to the app build.
The only thing that you have to bear in mind is that configuration files paths have to be prefixed with www.