Closed ewd3v closed 2 months ago
why?
why?
I mean true it can be argued this doesn't help much but I thought this could help with making code easier to read (since you're extracting relating code into their own code blocks). Sure using do statements achieve the same effect I guess, but extracting it into a function has the benefit of being able to add guard statements to that codeblock.
I also thought it wasn't a terrible idea when I thought of the ability to return a new value that the source should be updated to instead (though perhaps it should be renamed to "update" because of that).
So yeah, really just thought it made some code cleaner by removing some boilerplate code (just a utility function anyways).
I don't see why this should be included in vide; it doesn't make a pattern easier, nor does it need to do anything that requires it to be in vide
I don't see why this should be included in vide; it doesn't make a pattern easier, nor does it need to do anything that requires it to be in vide
Yeah it doesn't need to be in vide (just thought it might be interesting.
Utility function.
is the same as:
If the mutator function returns a new value the source will be updated to use that instead.