You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I just started looking at flyd so I would like to know suggestions for how to validate stream values before allowing side-effects.
For the Sum example, I was submitting values to the x and y streams through the console and noticed it wasn't validating input; inputting x('boo'), for instance, would still result in updating DOM.
I modified Sum so that it validates values before updating DOM.
Handling errors and validation within a stream were discussed here: #20 , #103 , #35 , and #69, and a pull request with a possible implementation (by build Either into flyd): #104
TL;DR, seems flyd is not concerned with errors -- the way you're dealing with them here is a fine solution, and tons of other options exist (the Either monad is an example from the PR).
I don't think that the examples need to be updated for this, but an example demonstrating some error handling strategies wouldn't be a bad idea.
Hello, I just started looking at flyd so I would like to know suggestions for how to validate stream values before allowing side-effects.
For the Sum example, I was submitting values to the x and y streams through the console and noticed it wasn't validating input; inputting
x('boo')
, for instance, would still result in updating DOM.I modified Sum so that it validates values before updating DOM.
Would this be a typical strategy to validate values? Are there other ways?
Thanks
The text was updated successfully, but these errors were encountered: