This is the Bacon.JS coding excercise we did at ReaktorDevDay 2012. Below are the instructions in case you wanna try it yourself. You may also have a look at the Full Solution which is in another branch.
Clone this repo
git clone https://github.com/raimohanska/bacon-devday-code.git
cd bacon-devday-code
Open the index.html file in your browser
open index.html
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.
Try some expression in the Developer Console, like
$("#username input").asEventStream("keyup")
Have a look at Bacon.js readme
Here's how I modeled the problem for Bacon.js reactive code.
Side-effects are not depicted.
Disable button if username is missing
Disable also if full name is missing
Disable also if username unavailable
Show AJAX indicator when AJAX pending
Disable button when AJAX is pending
Implement registerClick stream
Implement registrationRequest
Make this a stream of registration requests, send when the button is clicked
Create registrationResponse stream
Show feedback
Disable button after registration sent
Show ajax indicator for registration POST