Skip to content

Commit

Permalink
fix minor spellings
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip committed Jun 15, 2018
1 parent be88178 commit 733a37d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/electrode-react-webapp/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -41,7 +41,7 @@ For example:

- ie: `<!--%{my-token prop1="test" prop2=false prop3=[a, b, c]}-->`

- 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)

Expand Down Expand Up @@ -79,12 +79,14 @@ For example:
<!--{#./my-token-module _call=[setup1, [param1, param2]] }-->
```

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:
Expand Down Expand Up @@ -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]) => {}
};
Expand All @@ -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]) {}
};
Expand Down

0 comments on commit 733a37d

Please sign in to comment.