Dynamic prop/attr names
Abierto
discussion
proposal
- Lenguaje dominante
- JavaScript
- Estrellas
- 9k
- Forks
- 181
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Not the same as #109.
That would be useful to have insertable attribute names:
```js
html``
// same as
html``
```
## Practical cases
Optional attributes:
```js
html``
```
Private props:
```js
let html = htm.bind(h)
let _data = Symbol('data')
html``
function h (tag, props) {
props[_data]
}
```
Anonymous props:
```js
html``
function draggable(el) {
...
}
draggable[Symbol.toPrimitive] = () => 'data-draggable'
```
@developit @jviide would you consider that feature?
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.