Routes

Utility function regarding Routes

Build Query

Code Editor
Copy
import { buildQuery } from '@erudilabs/alma'
Code Editor
Copy
buildQuery('/profile', { ph:"bukas", id:"danacita" })

The result should be in below

'/profile?ph=bukas&id=danacita'


Build Path

Code Editor
Copy
import { buildPath } from '@erudilabs/alma'
Code Editor
Copy
buildPath('/profile/[username]', { username: "septiven" } )

The result should be in below

'/profile/septiven'


Code Editor
Copy
buildPath('/profile/[username]/[status]', { username: "septiven", status:'single' } )

The result should be in below

'/profile/septiven/single'