I haven’t used it but it does look interesting (can you pm me the yt link?). I used redux in a react app a few years back (was just a proof of concept app) and liked how it worked, but you do end up with a lot of boilerplate code (reducers etc).
I kinda use part of the concepts in my Delphi applications - using my VSoft.Messaging library - I use messages for two things
- To mutate the state.
- To notify when state has changed.
I’m currently rewriting Action Studio (part of FinalBuilder and Automise, an IDE for creating custom actions) - I have a ‘Project Service’ which manages the state (projects open in the IDE) and when ever the project service mutates the state of a project, it sends messages (projectOpened, projectClosed, projectModified etc) which other parts of the application (typically the UI frames) can react to. The messages can have a payload - in the case of the project messages it would be the project object. Also since the messages have the payload/data - I often do not need to hold the state in the subscribing object - I can just use the payload.
State mutation is mostly done inside the Project Service - either by calling it directly or by sending messages to it - or it sending messages out - e.g sending an ApplyChangesMessage which the forms and frames can subscribe to and update the supplied object.
I started out only sending messages to the service but that quickly became unmanageable - a bit like redux imho - the number of message types explodes very quickly.
Since I’m using the Spring4D container, I register a Message Service with the container that wrappers the messaging library that I can inject (or resolve in the case of forms, since spring4d doesn’t really do forms) for sending and subscribing to messages.
I like the messages because it decouples things nicely, and it makes it really easy to reason why something happens - if I see an odd behaviour that happens when I open a project, I’ll just search for the ProjectOpened message handlers and see what they do.
I’m still refactoring and evolving this architecture - so it’s very much a hybrid as I figure out how to achieve what I want. YMMV.