-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plugin-history-sync): add history queue context #417
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enqueue()
is a raw API-like name that reveals the perception that the inside is a queue, so I wonder if it would be right to expose it to the outside.
I understand that the queue is managed globally, but wouldn't it be better to remove the react dependency and use an API like requestHistoryTick()
? (I think there is a better name than this one... If so, please suggest one.)
import { requestHistoryTick } from "@stackflow/plugin-history-sync";
requestHistoryTick(() => {
console.log("Manipulate history safely here!")
});
Reference interfaces:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
URL navigations not managed in history sync plugin can be ignored when those are executed right after the stackflow actions.
This PR provides a solution about the issue by exposing
enqueue
function as a hook so that navigations could be inserted into the queue together.