diff options
author | Joris Guyonvarch | 2015-08-01 00:31:36 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-08-01 00:31:36 +0200 |
commit | c345f9daa28e0c174b35413addf78df0a793f8c1 (patch) | |
tree | 206f1d9aeed76b5c9e6f6abd24c00a50ec6c54fd /src/client/Native | |
parent | 043d315c4b15608e04a07cd709e4caf5c3758c61 (diff) |
Adding error feedbacks when adding a payment
Diffstat (limited to 'src/client/Native')
-rw-r--r-- | src/client/Native/Reads.js | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/client/Native/Reads.js b/src/client/Native/Reads.js index 52590f9..5785aed 100644 --- a/src/client/Native/Reads.js +++ b/src/client/Native/Reads.js @@ -7,18 +7,13 @@ Elm.Native.Reads.make = function(localRuntime) { return localRuntime.Native.Reads.values; } - var Result = Elm.Result.make(localRuntime); - - function div(a, b) - { - return (a/b)|0; - } + var Maybe = Elm.Maybe.make(localRuntime); function readInt(str) { var number = Number(str); - return isNaN(number) - ? Result.Err("unable to parse '" + str + "' as a number") - : Result.Ok(number); + return isNaN(number) || str === '' + ? Maybe.Nothing + : Maybe.Just(number); } return localRuntime.Native.Reads.values = { |