Skip to content

Conversation

@mmontone
Copy link
Contributor

@mmontone mmontone commented Aug 8, 2025

This is to be able to control browser history from server side in ajax requests/components.

For example, I use this in an ajax pagination controller, to change the current page in the browser: (history-push-state "?page=30")

@mmontone mmontone marked this pull request as draft August 8, 2025 20:09
(let ((action-code (when pop-action
(etypecase pop-action
(string pop-action)
(function (reblocks/actions:make-action pop-action))))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the docstring to browser-history-push-state I think we should mention that an action will be called with two arguments location and state.

Also, I'd prefer state argument of the browser-history-push-state to be a hash-table, but not sure if it will be deserialized into a hash-table propertly when action us called by the frontend.

@mmontone
Copy link
Contributor Author

Thanks for the comments. I'll apply. I'm not sure yet if I will deliver this like this, or as separate module in my reblocks-extras repository.

@svetlyak40wt
Copy link
Member

Thanks for the comments. I'll apply. I'm not sure yet if I will deliver this like this, or as separate module in my reblocks-extras repository.

Anyway, your idea seems very interesting to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants