Skip to main content
Version: Next

Set Navigation Route

Updates the URL state with a 'key-value'

Description

Allows to update or add a new key-value pair in the URL state, thereby modifying the route
If the provided key already exists in the state, the brick will replace the existing value with the new one. However, if the key is not found in the state, the function will insert the key-value pair into the URL. The brick also pushes a new navigation state.

Examples:

  • State: tab=first
  • Inputs:
    • key = menu
    • value = demand
  • Pushed state: menu=demand;tab=first
  • State: menu=demand;tab=first
  • Inputs:
    • key = menu
    • value = balance
  • Pushed state: menu=balance;tab=first

Inputs

  • Control Flow (Control Flow)
  • key (String): A string representing the key to be inserted or updated in the state. This key specifies the location in the URL where the value will be placed or modified. For example, in the state "menu=demand;tab=first", "menu" is a possible key.
  • value (String): A string representing the value associated with the provided key. This value will be inserted or updated in the URL state according to the given key. For instance, if the key is "menu" and the value is "balance", the state will be modified to "menu=balance;tab=first".

Outputs

  • Control Flow (Control Flow)