Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
shahrul committed Oct 13, 2024
1 parent d61d837 commit ae93bd6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ local filters = {
}

local content = table.concat(map(filters, function(filter)
-- convert to string
return h(<li>
<a
class={filter.selected and 'selected' or nil}
Expand All @@ -89,11 +90,15 @@ See the test folder to see more usage cases.

## Caveats

> Since nodeName such `div`, `p`, etc+ are used as declared variables, so do NOT declare a function with the same name i.e.,
- Since nodeName such `div`, `p`, etc+ are used as declared variables, so do **NOT** declare a function with the same name i.e.,

```lua
local function li()
return <li>todo 1</li>
end

```
- when using `table.concat` you need to convert to string so encapsulate with `h` pragma,
- defining in bracket try to limit by using `'` instead of `"` i.e., `{foo and 'foo' or nil}`,
- leave attributes assignment with no spacing `{ foo="foo" }` instead of `{ foo = "foo" }`,
- <!--> HTML comments, not supported yet.

0 comments on commit ae93bd6

Please sign in to comment.