This gem implements the redux (a.k.a. flux) pattern to be used in combination with Rails and Hotwire. What the gem does is: add a json store to a model, in this store keep a list of actions, an initial state and the current state. The gem adds some methods to the model to add, undo and redo actions. The developer needs to provide a set of reducer functions that can update the current state when passed a new action. The current state can be used when rendering views.
Note that this is my first Rails plugin, there may well be better ways to implement it. There is a demo client in the repo if you are interested in trying it out. Github repo