diff --git a/packages/electrode-react-webapp/DESIGN.md b/packages/electrode-react-webapp/DESIGN.md index 4fcb55062c..7e9097d3c2 100644 --- a/packages/electrode-react-webapp/DESIGN.md +++ b/packages/electrode-react-webapp/DESIGN.md @@ -22,7 +22,7 @@ The design of the rendering flow took the following into consideration. - Tokens can also be multi lines. - - Comments can be added as lines that starts with `//`. + - Comments can be added as lines that start with `//`. - Comments must be in their own lines only. @@ -41,7 +41,7 @@ For example: - ie: `` - - String prop value must be string enclode in `"` or `'`. + - String prop value must be string enclosed in `"` or `'`. - Values started with `[` will be parsed with [string-array](https://www.npmjs.com/package/string-array) @@ -79,12 +79,14 @@ For example: ``` -This will call the function `setup1(context, options, a, b)` from your module like this: +This will call the function `setup1(options, tokenInstance, a, b)` from your module like this: ```js -tokenModule.setup1(context, options, "param1", "param2"); +tokenModule.setup1(options, tokenObj, "param1", "param2"); ``` +Where `tokenObj` is the your token's instance object. + ## Predefined Tokens and Handler These are tokens that are automatically processed internally: @@ -120,7 +122,7 @@ You can register a token handler for each route. The token handler should export For example: ```js -module.exports = function setup(options) { +module.exports = function setup(options, tokenObj) { return { SSR_CONTENT: (context, [next]) => {} }; @@ -137,7 +139,7 @@ module.exports = function setup(options) { The custom processor module should export an initialize function as below: ```js -module.exports = function setup(options) { +module.exports = function setup(options, tokenObj) { return { process: function(context, [next]) {} };