kitbagjs / router

A type safe router for vuejs
https://router.kitbag.dev
MIT License
173 stars 4 forks source link

Refactor of how hooks are run to account for different timing and outcomes #108

Closed pleek91 closed 6 months ago

pleek91 commented 6 months ago

Description

Prior to this there was a single utility for executing route hooks that would return a boolean based on if something like a push, replace, or reject happened. This wasn't enough information for the update method in createRouter to know what to do.

I've added stronger types for BeforeRouteHook and AfterRouteHook and defined types for BeforeRouteHookResponse and AfterRouteHookResponse. Each response has a status like abort, push, reject, or success. The abort status is new altogether and is only included for before hooks.

netlify[bot] commented 6 months ago

Deploy Preview for kitbag-router ready!

Name Link
Latest commit dab032512600238c5b1e1bc87f80a00eec080140
Latest deploy log https://app.netlify.com/sites/kitbag-router/deploys/65fef45018f3700008eb71b3
Deploy Preview https://deploy-preview-108--kitbag-router.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.