Helper functions for parsing url to update values #6

Open
opened 2019-06-03 19:40:21 +00:00 by KevinMidboe · 0 comments
KevinMidboe commented 2019-06-03 19:40:21 +00:00 (Migrated from github.com)

This could be useful on multiple sites and should be modular enough to return what we want to directly set in result to what was found in the url.

Examples of potential use:

parse URI

  • We get the route name
  • Check if route is of name
  • Find matching list, compute new title and fetch listResults
    or
  • Get the query from uri, compute new title and fetch searchResults
  • set document title

load More

  • Increments page count from local scope
  • compute url with new page query count based on named route
  • window replaceState to new url
    --> Parse URI

set Page From URL Query

  • Gets route query : page
  • sets local scope currentPage to page query value

before Mount calls several of these, could this be solved better if ones results are required by the next function call?

This could be useful on multiple sites and should be modular enough to return what we want to directly set in result to what was found in the url. Examples of potential use: ## parse URI - We get the route name - Check if route is of name - Find matching list, compute new title and fetch listResults or - Get the query from uri, compute new title and fetch searchResults - set document title ## load More - Increments page count from local scope - compute url with new page query count based on named route - window replaceState to new url --> Parse URI ## set Page From URL Query - Gets route query : page - sets local scope currentPage to page query value before Mount calls several of these, could this be solved better if ones results are required by the next function call?
Sign in to join this conversation.
No description provided.