Skip to content

Commit

Permalink
fix typo in proxy events and add deprecation notice for dynamic names…
Browse files Browse the repository at this point in the history
… in proxy events

 fixes ractivejs/ractive#2850
 closes ractivejs/ract#2849
  • Loading branch information
evs-chris committed Jan 30, 2017
1 parent 7ebae96 commit 90761f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/0.8/Proxy events.md.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ Note: the built-in {{{createLink 'lifecycle events'}}} are **reserved**, which m

## Dynamic proxy event names

__Note:__ This functionality is deprecated and will be removed in 0.9. If you need dynamic event names to fire, you can use a method event calling fire with an expression for the name. If you just need an event to be dynamically subscribed, you can place it in an `\{{#if}}` conditional.

{{{createLink 'Mustaches' 'Mustache references'}}} can be used as proxy event names:

```html
<button on-click="\{{handler}}">click me!</button>
```

In practive this is of limited value, but a more important side effect is that if no handler is specified (a falsey value) the DOM event is not subscribed and will unsubscribe or resubscribe as the handler value changes. Combined with a conditional section, this allows a proxy event to be conditionally subscribed _at the DOM level_:
In practice this is of limited value, but a more important side effect is that if no handler is specified (a falsey value) the DOM event is not subscribed and will unsubscribe or resubscribe as the handler value changes. Combined with a conditional section, this allows a proxy event to be conditionally subscribed _at the DOM level_:

```html
<button on-click="\{{#active}}select\{{/}}">click me!</button>
Expand Down

0 comments on commit 90761f1

Please sign in to comment.