• This repository has been archived on 21/Apr/2018
  • Stars
    star
    372
  • Rank 114,858 (Top 3 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

RxJS Koans

Learn the Reactive Extensions for JavaScript (RxJS) with RxJS Koans

The Koans walk you along the path to enlightenment in order to learn RxJS. The goal is to learn the RxJS library. We also teach you culture. Testing is not just something we pay lip service to, but something we live. It is essential in your quest to learn and do great things in the library.

Structure

The koans are broken out into areas by file, events are covered in about_events.js, time is introduced in about_time.js, etc. They are presented in order in the index.js file.

Each koan builds up your knowledge of RxJS and builds upon itself.

Some koans simply need to have the correct answer substituted for an incorrect one. Some, however, require you to supply your own answer. If you see the method __ (a double underscore) listed, it is a hint to you to supply your own code in order to make it work correctly.

Installing Node.js

In order to run the koans you need Node.js installed. If you do not already have Node.js set up, please visit the Node.js site to install Node.js.

To verify your installation, in your terminal window simply type:

$ node --version

Any response for Node with a version number greater than 0.10.x is fine.

Installing the RxJS Koans

To install the RxJS Koans, download via Git and add the depdencies via NPM:

$ git clone https://github.com/Reactive-Extensions/RxJSKoans.git
$ cd RxJSKoans
[RxJSKoans ]$ npm install

The Path to Enlightenment

You can run the tests by calling npm test at your terminal window.

[RxJSKoans] $ npm test

Red, Green, Refactor

In test-driven development (TDD) the mantra has always been red: write a failing test and run it, green: make the test pass, and refactor: look at the code and see if you can make it any better.

With the koans, you will need to run the tests and see it fail (red), make the test pass (green), then take a moment and reflect upon the test to see what it is teaching you and improve the code to better communicate its intent (refactor).

The very first time you run it you will see the following output:

  Observable Streams
    1) simple subscription

  1) Observable Streams simple subscription:
     Error: expected 42 to equal undefined

You have come to the first error. You then open up the about_streams.js file in your text editor and look at simple subscription:

test('simple subscription', function () {
  Observable.just(42).subscribe(function (x) { equal(x, __); });
});

You then change __ to 42 and run the tests again. You should now have fixed the error.

Before moving on, think about what you are learning.

In this specific case, ignore everything except the method name and the parts inside the method. The goal is for you to see that if you pass a value to the proper assertion method method, it will either ensure it is true and continue on, or fail if in fact the statement is false.

License

Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

RxJS

The Reactive Extensions for JavaScript
JavaScript
19,482
star
2

rx.angular.js

AngularJS Bindings for RxJS
JavaScript
827
star
3

RxJS-DOM

HTML DOM Bindings for the Reactive Extensions for JavaScript
JavaScript
437
star
4

rx-node

RxJS Bindings for Node.js and io.js
JavaScript
219
star
5

rxjs-jquery

Reactive Extensions bindings for jQuery
JavaScript
213
star
6

IxJS

Interactive Extensions for JavaScript
JavaScript
157
star
7

IL2JS

IL to JavaScript Compiler
C#
143
star
8

LevelDB

LevelDB for Windows and .NET
C++
116
star
9

RxPy

The Reactive Extensions for Python
Python
102
star
10

rxjs-node

Reactive Extensions bindings for node.js
JavaScript
70
star
11

FutureJS

Presentation from FutureJS
JavaScript
44
star
12

Reactor

Foundations for a distributed implementation of Rx.
C#
39
star
13

Rx.ObjC

Reactive Extensions for ObjC
Objective-C
29
star
14

rx.disposables

Standalone library for disposables from RxJS
JavaScript
27
star
15

RxJS-CLI

Reactive Extensions for JavaScript (RxJS) Command Line Interface
JavaScript
23
star
16

RxJS-WinJS

The Reactive Extensions for JavaScript bindings for Windows 8 and WinJS
JavaScript
22
star
17

BuildStuffWorkshop

Workshop for BuildStuff.LT 2014
15
star
18

NDC-Oslo-2014

NDC Oslo 2014 Presentation on Democratizing event processing at all scales and platforms with Reactive Extensions (Rx)
JavaScript
14
star
19

rxjs-winjs-sample

Using RxJS for Windows 8
JavaScript
14
star
20

RxToBand

Reactive Extensions (Rx) support for the Microsoft Band
C#
13
star
21

StrangeLoop2013

StrangeLoop 2013 Rx Presentation
JavaScript
12
star
22

RxJS-Combinators

A functional combinator library
JavaScript
11
star
23

rx.schedulers

Standalone implementation of the RxJS schedulers
JavaScript
11
star
24

RxJS-Contrib

The Reactive Extensions for JavaScript Contrib Project
JavaScript
11
star
25

rx.priorityqueue

Standalone Priority Queue from the RxJS library
JavaScript
10
star
26

RxJS-Dojo

Reactive Extensions bindings for the Dojo Toolkit
JavaScript
10
star
27

RxJS-ExtJS

Ext JS Bindings for the Reactive Extensions for JavaScript (RxJS)
JavaScript
9
star
28

Rx-Edge

Reactive Extensions for Edge.js
JavaScript
5
star
29

RxJS-MooTools

MooTools Bindings for the Reactive Extensions for JavaScript (RxJS)
JavaScript
4
star
30

IxJS-ES6

An ES6 version of the Interactive Extensions for JavaScript (IxJS)
JavaScript
3
star
31

RxJS6

2
star
32

Rx-Summit-2013

Reactive Extensions Summit 2013
2
star
33

blog-posts

Blog posts for posting about Rx
1
star
34

RxJSx

An experimental version of the Reactive Extensions
JavaScript
1
star