Skip to content

Commit

Permalink
docs(readme): adjust to pipeline change
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The new pipeline 2.0.0 no longer merges the return
  values from pipeline functions. The context needs to manipulated
  directly.
  • Loading branch information
tripodsan committed May 16, 2019
1 parent 52fd984 commit f5a1509
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,9 @@ A minimal functional JavaScript template function must export a `main` function
```javascript
// exporting `main` is mandatory
module.exports.main = (context, action) {
return {
response: {
// setting the body is the purpose of the function
body: 'Hello World'
}
context.response = {
// setting the body is the purpose of the function
body: 'Hello World'
};
}
```
Expand Down Expand Up @@ -562,12 +560,10 @@ function MyComponent(context) {
}

module.exports.main = context => {
return {
response: {
// the response body needs to be a string, so taking the `outerHTML` of
// the topmost component is a good choice.
body: MyComponent(context).outerHTML
}
context.response: {
// the response body needs to be a string, so taking the `outerHTML` of
// the topmost component is a good choice.
body: MyComponent(context).outerHTML
};
};
```
Expand Down

0 comments on commit f5a1509

Please sign in to comment.