Skip to content
This repository was archived by the owner on Aug 14, 2018. It is now read-only.

Commit dde6092

Browse files
committed
V0.0.1
0 parents  commit dde6092

File tree

9 files changed

+445
-0
lines changed

9 files changed

+445
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"stage": 0
3+
}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
.idea
3+
resolve.js
4+
Resolver.js
5+
index.js
6+
7+
!src/*

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node-modules
2+
.idea
3+
src

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 David Zukowski
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "react-esc-resolver",
3+
"version": "0.0.1",
4+
"description": "Easy to use Client and Server Resolver",
5+
"homepage": "https://github.com/TriPSs/react-esc-resolver",
6+
"bugs": {
7+
"url": "https://github.com/TriPss/react-esc-resolver/issues"
8+
},
9+
"license": "MIT",
10+
"author": {
11+
"name": "Tycho Bokdam",
12+
"email": "t.bokdam@seronaris.nl"
13+
},
14+
"main": "./index.js",
15+
"directories": {
16+
"test": "test"
17+
},
18+
"repository": {
19+
"type": "git",
20+
"url": "git://github.com/TriPSs/react-esc-resolver.git"
21+
},
22+
"scripts": {
23+
"build": "babel src -d ./",
24+
"prepublish": "npm run build"
25+
},
26+
"devDependencies": {
27+
"babel": "5.8.34",
28+
"react": "^15.0.0",
29+
"react-dom": "^15.0.0"
30+
},
31+
"peerDependencies": {
32+
"react": "^0.14.6 || ^15.0.0-0",
33+
"react-dom": "^0.14.6 || ^15.0.0-0"
34+
}
35+
}

readme.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# React-ESC-Resolver ![https://img.shields.io/npm/v/react-esc-resolver.svg](https://img.shields.io/npm/v/react-esc-resolver.svg?style=flat-square) [![](https://img.shields.io/github/issues-raw/tripss/react-esc-resolver.svg?style=flat-square)](https://github.com/tripss/react-esc-resolver/issues) [![](https://img.shields.io/david/tripss/react-esc-resolver.svg?style=flat-square)](https://david-dm.org/tripss/react-esc-resolver#info=dependencies)
2+
3+
> Async-rendering & data-fetching for universal React applications.
4+
5+
###### This project is based on [react-resolver](https://github.com/ericclemmons/react-resolver)
6+
React ESC Resolver lets you **define data requirements _per-component_**
7+
and will **handle the nested, async rendering on both the server & client for you.**
8+
9+
For example, the following will load & provide `this.props.user` for the
10+
`UserProfile` component:
11+
12+
```js
13+
import { resolve } from 'react-esc-resolver';
14+
15+
@resolve('user', function(props) {
16+
return http.get(`/api/users/${props.params.userId}`);
17+
})
18+
class UserProfile extends React.Component {
19+
render() {
20+
const { user } = this.props;
21+
...
22+
}
23+
}
24+
```
25+
26+
This is the equivalent to asynchronously loading `user` and providing it to
27+
the component as if it were provided directly:
28+
29+
```xml
30+
<UserProfile user={user} />
31+
```
32+
33+
This makes components _pure_, _stateless_, and _easy to test_ as a result.
34+
35+
36+
### Installation
37+
```shell
38+
$ npm install --save react-esc-resolver
39+
```
40+
41+
## Development
42+
43+
If you'd like to contribute to this project, all you need to do is clone
44+
this project and run:
45+
46+
```shell
47+
$ npm install
48+
$ npm test
49+
```
50+
51+
## [License](https://github.com/tripss/react-esc-resolver/blob/master/LICENSE)
52+
53+
> Internet Systems Consortium license
54+
> ===================================
55+
>
56+
> The MIT License (MIT)
57+
>
58+
> Copyright (c) 2015 David Zukowski
59+
>
60+
> Permission is hereby granted, free of charge, to any person obtaining a copy
61+
> of this software and associated documentation files (the "Software"), to deal
62+
> in the Software without restriction, including without limitation the rights
63+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
64+
> copies of the Software, and to permit persons to whom the Software is
65+
> furnished to do so, subject to the following conditions:
66+
>
67+
> The above copyright notice and this permission notice shall be included in all
68+
> copies or substantial portions of the Software.
69+
>
70+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
71+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
72+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
73+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
74+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
75+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
76+
> SOFTWARE.
77+
78+
## Collaboration
79+
80+
If you have questions or issues, please [open an issue](https://github.com/TriPSs/react-esc-resolver/issues)!

0 commit comments

Comments
 (0)