Convenience function to update a form value with a Float value. If the user input does not return
a number with parseFloat, no state change occurs. Pass the Meiosis cell and the state property
(such as 'pH') or path (such as ['water', 'pH']) into which to update the value. Returns a
function that you can pass to a DOM handler, such as oninput (Mithril) or onInput (Preact,
React). For example:
// Using Mithil m('input[type=text]', { oninput:updateFormFloatValue(cell, 'pH') })
// Using Preact/React <inputtype="text"onInput={updateFormFloatValue(cell, ['water', 'pH'])}/>
Returns
a function that accepts a DOM event and updates the value on the Meiosis state.
Convenience function to update a form value with a Float value. If the user input does not return a number with
parseFloat
, no state change occurs. Pass the Meiosis cell and the state property (such as'pH'
) or path (such as['water', 'pH']
) into which to update the value. Returns a function that you can pass to a DOM handler, such asoninput
(Mithril) oronInput
(Preact, React). For example:Returns
a function that accepts a DOM event and updates the value on the Meiosis state.