Home

Awesome

Preparations

  1. Clone this repo

    git clone https://github.com/raimohanska/bacon-mloc-code.git
    cd bacon-devday-code
    
  2. Open the index.html file in your browser

    open index.html
    
  3. Make sure you have developer tools in your browser and that you can use them. Google Chrome will do. In Chrome (Mac OSX), Go to View -> Developer -> Developer Tools. You should be able to run Javascript expressions on the Console tab.

  4. Try some expression in the Developer Console, like

    $("#username input").asEventStream("keyup")
    
  5. Have a look at Bacon.js readme

Map

Here's how I modeled the problem for Bacon.js reactive code.

diagram

Side-effects are not depicted.

Steps to success

  1. Disable button if username is missing
  1. Disable also if full name is missing
  1. Disable also if username unavailable
  1. Show AJAX indicator when AJAX pending
  1. Disable button when AJAX is pending

  2. Implement registerClick stream

  1. Implement registrationRequest
  1. Make this a stream of registration requests, send when the button is clicked
  1. Create registrationResponse stream
  1. Show feedback

  2. Disable button after registration sent

  3. Show ajax indicator for registration POST