Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
reformatted if-else to ternary op
Browse files Browse the repository at this point in the history
  • Loading branch information
pflannery committed Feb 4, 2015
1 parent 5a161b1 commit 2f0775b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/NodeBind.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,8 @@
var eventType = getEventForInputType(input);

function eventHandler() {
if (property == 'value' && input.type == 'number' )
observable.setValue(input.valueAsNumber);
else
observable.setValue(input[property]);

var isNum = property == 'value' && input.type == 'number';
observable.setValue(isNum ? input.valueAsNumber : input[property]);
observable.discardChanges();
(postEventFn || noop)(input);
Platform.performMicrotaskCheckpoint();
Expand Down

0 comments on commit 2f0775b

Please sign in to comment.