1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-02-15 07:25:54 +00:00
Files
frontend/preact-src/trigger/util.js
Paulus Schoutsen ca82a411aa Add automation editor (#275)
* Add automation editor

* Build JS before running tests

* Add browser warning

* Re-order from/to in state
2017-05-09 09:37:10 -07:00

12 lines
253 B
JavaScript

export function onChange(ev) {
const trigger = { ...this.props.trigger };
if (ev.target.value) {
trigger[ev.target.name] = ev.target.value;
} else {
delete trigger[ev.target.name];
}
this.props.onChange(this.props.index, trigger);
}