Describe The Problem To Be Solved
on the server getRequestEvent() has Request.url but its not a convenient URL object, and on the client we have location which is not exactly the same as URL
Suggest A Solution
import { getRequestEvent, isServer } from "solid-js/web";
function useUrl() {
return new URL(isServer ? getRequestEvent()!.request.url : location.href);
}
should this be added? just a suggestion!
Describe The Problem To Be Solved
on the server
getRequestEvent()hasRequest.urlbut its not a convenientURLobject, and on the client we havelocationwhich is not exactly the same asURLSuggest A Solution
should this be added? just a suggestion!