You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would something like this be a bad idea? And is there some built-in function that would be able to check if route matches pattern (I imagine link active has to be doing something like that).
privateaction$=createEffect(()=>this._router.url$.pipe(// url is /products/detail/123filter((url)=>ofRoute('/products/detail/:id',url)),tap(console.log));
The text was updated successfully, but these errors were encountered:
There isn't a built in function that does this for the entire route, as each segment is parsed at each level in the component hierarchy. Maybe if the effect was tied to the component?
The ofRoute() would match as soon as the location changes, but would potentially happen before the component is rendered. If you're keeping things reactive if should be fine though.
The ofRoute() would match as soon as the location changes, but would potentially happen before the component is rendered. If you're keeping things reactive if should be fine though.
yea that would be fine in this case, you visit product/123 and you want to check if 123 data already exists and dispatch load action otherwise, I could always dispatch the action from the page component, but I'd rather leave it to the effect
With implementation of custom route matched (currently in PR) this would be possible even with the service, but you would have to manually run the checks that components do.
As Brandon said, it's best to use components. We didn't implement public route change events yet.
Would something like this be a bad idea? And is there some built-in function that would be able to check if route matches pattern (I imagine link active has to be doing something like that).
The text was updated successfully, but these errors were encountered: