react-tops
A React project designed to show optmistic render on the client
side while asynchronously calling the server for validation. This project
also has tests using Jasmine, which are run on Karma.
The client pools the server each second for a random word and shows the last
10 words. The user can submit new words, which will appear on the list
immediately and submited to the server.
The server has an artificial delay of 2 seconds before returning a response.
If the word has more than 6 characteres the server will tell that is a
invalid word and the client will show in a different manner valid and invalid
words.
Dependencies
Usage
-
Open a repl. In another terminal:
$ lein repl
-
Require the core namespace. This will start the server. On the repl:
user=> (require 'react-tops.core) -
Go to http://localhost:8003 in your browser.
Testing
You need to install karma and some plugins before running the tests. In a terminal:
npm install karma karma-jasmine karma-chrome-launcher karma-firefox-launcherYou should also install karma-cli because it makes your life easier. In a terminal (you may need sudo):
npm install -g karma-cliNow to run the tests:
-
Start the karma runner. In another terminal:
$ karma start
-
When you save a file, the tests will auto run.
License
Copyright © 2014, Marcelo Nomoto. All rights reserved.
The use and distribution terms for this software are covered by the Eclipse
Public License 1.0 (http://opensource.org/licenses/EPL-1.0) which can
be found in the file epl-v10.html at the root of this distribution. By using
this software in any fashion, you are agreeing to be bound by the terms of
this license. You must not remove this notice, or any other, from this software.