The great story of me trying to reduce the Redux setup in my React application as much as possible, — and succeeding in it.
Comment on this line if you hate the Redux setup in an app that you develop. Did you do that? I thought so.
Saving refresh token
Thank you for the article!
The problem with this approach is that the server becomes stateful (the `refreshTokens` object being a part of the state). However, REST architecture requires servers to be stateless, which means that if a server chooses this approach, it cannot be RESTful anymore.
Read the last line of a file? Yep.
Count usage of a given word in a text? Check.
Validate user input? All the time!
These are the tasks that we, as software engineers, come across pretty frequently. Chances are, you have already ran into one of them at some point. But there is one thing that makes them very similar to each other — in most cases they are better handled with regular expressions.
I know, I know, regular expressions have a reputation of being unnecessarily overcomplicated. The goal of this article is exactly to show you that this is…
In my previous article I’ve briefly mentioned Valuer, which is a great tool to validate values before actually using them. Now I thought that it would be nice to fully introduce it, and also make a brief walk-through of its features.
Let’s start with an example. Suppose, you want to restrict some numbers to be natural. That’s classic. The task is to return the input if it fits the definition of natural numbers, otherwise throw an error describing what went wrong.
Usually you would do this kind of task using
if .. else statements and
undefined?” This lack of understanding takes place because both of them indicate some kind of emptiness, but each in its own different way.
The difference is about certainty.
null basically says “there’s nothing here, move along.” And this is for real, you can be certain about that.
null can be found in places where the value is optional or might not exist. E.g. …