Skip to content

Commit

Permalink
mention bindings in template strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Aylur committed May 7, 2024
1 parent 4ac618c commit f91fef0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/content/docs/config/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ or setup a `hook`.
A `Binding` is just an object that holds information for widget constructors
to setup a listener.

:::caution
`Binding` is a regular JavaScript object,
it cannot be used in template strings

```js
const label = Variable("hello")

Label({
// [Object object] world
label: `${label.bind()} world`,

// hello world
label: label.bind().as(hello => `${hello} world`)
})
```

:::

## Property Bindings

We can make a `Binding` from a Variable
Expand Down

0 comments on commit f91fef0

Please sign in to comment.