Skip to content

Commit

Permalink
Updated README;
Browse files Browse the repository at this point in the history
Updated CHANGELOG;
  • Loading branch information
DigitalBrainJS committed Dec 11, 2020
1 parent b07585d commit 96ed673
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

For changes before version 0.4.0, please see the commit history

## [0.10.6] - 2020-12-089
## [0.10.7] - 2020-12-12

### Added
- `promisify` method;

## [0.10.6] - 2020-12-09

### Added
- `weight`, `innerWeight` and `label` options for the `async` decorator;
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,27 @@ console.log('isPromise:', promise instanceof Promise); // true

setTimeout(()=> promise.cancel(), 1000);
````
Using decorators in React component to manage async tasks
````jsx
export class FetchComponent extends React.Component {
state = {text: ""};

@timeout(5000)
@listen
@async
*componentDidMount() {
const response = yield cpFetch(this.props.url);
this.setState({ text: `json: ${yield response.text()}` });
}

render() {
return <div>{this.state.text}</div>;
}

@cancel()
componentWillUnmount() {}
}
````

## Why :question:

Expand Down
20 changes: 20 additions & 0 deletions jsdoc2md/README.hbs.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,27 @@ console.log('isPromise:', promise instanceof Promise); // true

setTimeout(()=> promise.cancel(), 1000);
````
Using decorators in React component to manage async tasks
````jsx
export class FetchComponent extends React.Component {
state = {text: ""};

@timeout(5000)
@listen
@async
*componentDidMount() {
const response = yield cpFetch(this.props.url);
this.setState({ text: `json: ${yield response.text()}` });
}

render() {
return <div>{this.state.text}</div>;
}

@cancel()
componentWillUnmount() {}
}
````

## Why :question:

Expand Down

0 comments on commit 96ed673

Please sign in to comment.