UNPKG

reactron

Version:

Reactron - Transactional Reactive Front-End Development Framework

12 lines (11 loc) 387 B
import { Reaction } from '../core/Elements'; export function RxFocuser(name, target, model, switchEditMode = undefined) { Reaction(name, { target, model }, (_, node) => { if (switchEditMode !== undefined) { switchEditMode(model); } else { model.isEditMode ? target.focus() : target.blur(); } }, undefined, undefined, 0); }