Back 守卫
自动保护安装时的当前 entry,并拦截 scope 内 pushState 记录的单步 Back。
import { create, install } from "@revfanc/guard"
install()
const stop = create(async (resolve) => {
if (await confirmLeaving()) resolve()
})install()必须早于路由器第一次 pushState()。默认保护当前 URL;也可使用 scope只为指定路由创建 edge。