GithubHelp home page GithubHelp logo

most-koans's Introduction

Most.js Koans

公案

The Most.js Koans are a fun and easy way to get started with this awesome reactive programming toolkit. No experience assumed or required. Just follow the instructions below to start making tests pass!

Getting Started

The koans are broken out into chapters by file, transformations are covered in 02_transforming_streams.js, higher order streams is introduced in 10_combining_higher_order_streams.js, etc.

Installing

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

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

$ node --version

The Path to Enlightement

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

~/projects/github/most-koans $ npm test

For now, you have to update "test": "ava --watch test/00_creating_streams.js" in packge.json and restart a test runner with npm test when you ready to move to the next chapter.

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).

Contributing

Patches are encouraged! Just add whatever the fuck you want to.

Credits

The main idea is taken from the clojure-koans.

The project structure and many other things are borrowed from the RxJSKoans.

License

WTFPL – Do What the Fuck You Want to Public License.

most-koans's People

Contributors

vyorkin avatar

Stargazers

Andrejs Agejevs avatar Brian Cavalier avatar  avatar

Watchers

 avatar  avatar

most-koans's Issues

Simplify

For now, you have to update "test": "ava --watch test/00_creating_streams.js" in packge.json
and restart a test runner with npm test when you ready to move to the next chapter.

ava runs all in parallel, so maybe its better to use tape or smth else, need to think about it. I have a branch where I've tried switching to tape, but it looks ugly.

Add more koans

make a koan demonstrating the difference between these 2:

const source = most.from(numbers)
  .zip(identity, most.periodic(50));
const source = most.from(numbers)
  .concatMap(x => most.of(x).delay(50));
test('title', async t => {
  await most.from([1, 2, 3])
    .concatMap(x => most.of(x).delay(1000))
    .tap(console.log)
    .drain();
});

exercises:

  1. implement pauseable stream
  2. make a buffered pauseable stream
  3. double click

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.