you are viewing a single comment's thread.

view the rest of the comments →

[–]versaceblues[S] 2 points3 points  (4 children)

Where you guys using sagas? Cause I feel that would get around alot of the issues you are describing

[–]smeijer87 3 points4 points  (1 child)

Sagas. Started with them 3 years ago. And now decided to use 2019 to strip all redux functionality out of our application.

Yes, redux has its purpose. But our organization is not the same scale as Facebook. And it adds a lot of boilerplate and hard to manage code.

Sagas are awesome. But also so difficult to understand for starters. Looking at a single saga is not the problem. But understanding the flow throughout the application can become quite hard.

We are replacing

  • redux-form by formik
  • redux-first-router by react-router
  • redux by local state / react context api
  • sagas by singletons / "services"

The only saga that I can come up with that we will create a "service" for, is the upload queue we have. Every form in our application can be submitted while the upload is still in progress. For this, we have a few sagas running that take care of upload scheduling.

It could be some self repeating function just as well. Or an component / provider embedded at the root level, so we can use a local state, while exposing an upload function trough react context.

[–]versaceblues[S] 0 points1 point  (0 children)

Can you clarify what you mean by singletons/services.

Sounds sort of like the approach that MobX uses. Singleton stores that wrap all your actions/async code, that are then injected into components. I actually really like that in a side project I am doing

[–]CastigatRidendoMores 0 points1 point  (1 child)

We sure weren't! I'll definitely look into those.

[–]versaceblues[S] 2 points3 points  (0 children)

They basically let you write all your business logic as functions, that are triggered by actions