diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..3a14c14
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,8 @@
+dist: trusty
+sudo: false
+language: node_js
+node_js:
+ - 'stable'
+cache:
+ directories:
+ - node_modules
diff --git a/README.md b/README.md
index d4f2e02..711a5cf 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
oo7-react
=========
-A small library to provide integration between React and `Bond`s.
+A small library to provide integration between React and [`Bond`s](https://github.com/ethcore/oo7#oo7).
Provides two React components: `ReactiveComponent` and `Reactive`. The first
provides an alternative to `React.Component` for classes whose state shall
@@ -18,47 +18,47 @@ The element will stay updated to the latest value of each expression.
## Installation
```sh
- npm install oo7-react --save
+npm install oo7-react --save
```
## Usage
```javascript
- // Assume React is already required.
- var oo7react = require('oo7-react'),
- setupBonds = oo7parity.setupBonds,
- formatBlockNumber = oo7parity.formatBlockNumber;
+// Assume React is already required.
+var oo7react = require('oo7-react'),
+ setupBonds = oo7parity.setupBonds,
+ formatBlockNumber = oo7parity.formatBlockNumber;
- class DateFormatter extends ReactiveComponent {
- constructor() {
- // Tell the object to look out for 'date' prop and keep the 'date'
- // state up to date.
- super(['date']);
- }
- render() {
- return this.state.date === null ?
-
Date unknown
:
- The date is {this.state.date}
;
- }
- }
+class DateFormatter extends ReactiveComponent {
+ constructor() {
+ // Tell the object to look out for 'date' prop and keep the 'date'
+ // state up to date.
+ super(['date']);
+ }
+ render() {
+ return this.state.date === null ?
+ Date unknown
:
+ The date is {this.state.date}
;
+ }
+}
- class App extends React.Component {
- render() {
- // Evaluates to a pretty datetime.
- let b = (new TimeBond).map(t => new Date(t) + '');
- // Prints two clocks. They both print the time and stay up to date.
- return ()
- }
- }
+class App extends React.Component {
+ render() {
+ // Evaluates to a pretty datetime.
+ let b = (new TimeBond).map(t => new Date(t) + '');
+ // Prints two clocks. They both print the time and stay up to date.
+ return ()
+ }
+}
```
## Tests
```sh
- npm test
+npm test
```
## Contributing
diff --git a/package.json b/package.json
index 670b6a1..bcfc0e8 100644
--- a/package.json
+++ b/package.json
@@ -3,11 +3,13 @@
"version": "0.1.2",
"description": "The Reactive Bond API",
"main": "lib/index.js",
+ "jsnext:main": "src/index.jsx",
"files": [
- "lib/*"
+ "lib/*",
+ "src/*"
],
"scripts": {
- "test": "npm run compile && mocha --compilers js:babel-core/register --reporter spec",
+ "test": "npm run compile && mocha --compilers js:babel-core/register --reporter spec",
"compile": "babel --presets es2015,react -d lib/ src/",
"prepublish": "npm run compile"
},
@@ -31,7 +33,8 @@
"dependencies": {
"material-ui": "^0.16.7",
"oo7": "^0.1.2",
- "react": "^15.4.2"
+ "react": "^15.4.2",
+ "react-dom": "^15.4.2"
},
"devDependencies": {
"babel-cli": "^6.22.2",