Hi, everyone! I developed this simple little lib (my first lib!) to help me reduce some repetition in my action creators. If you have any constructive critiques I would be very pleased to hear it. If you have some interest in the project and can help, it would be awesome!
The problem:
Let's say that I want to fetch a list of books. Using redux, I have to create three actions creators:
You can see that we are repeating the same patterns in all our actions!
Now let's say that I want to fetch a list of authors. Or a list of books. Or a list of bookmarks... This pattern of REQUEST-SUCCESS-FAIL can become very repetitive and verbose.
The solution
Using reshort you can create one "complete action creator" using one line, instead of three. Like so:
Reshort - write less in your action creators!
Intro
Hi, everyone! I developed this simple little lib (my first lib!) to help me reduce some repetition in my action creators. If you have any constructive critiques I would be very pleased to hear it. If you have some interest in the project and can help, it would be awesome!
The problem:
Let's say that I want to fetch a list of books. Using redux, I have to create three actions creators:
Like so:
You can see that we are repeating the same patterns in all our actions!
Now let's say that I want to fetch a list of authors. Or a list of books. Or a list of bookmarks... This pattern of REQUEST-SUCCESS-FAIL can become very repetitive and verbose.
The solution
Using
reshort
you can create one "complete action creator" using one line, instead of three. Like so: