2 ms·
In our case if we want to share some of the logic in a reducer/action-creator or something else, we write "helper" functions that handle the heavy lifting, and
by Klathmon 9y ago
In our case if we want to share some of the logic in a reducer/action-creator or something else, we write "helper" functions that handle the heavy lifting, and call them from the action-creator.
This way we can easily test and reuse the actual "hard logic" for those parts, don't need to worry about trying to reuse the actual Redux stuff, and can add/modify the input or result from the helper functions slightly if needed per app.
Yes, it's more boilerplate, but it's served us well.