Skip to main content

Syntax

removeFromContext(key, value, mode)

Description

Removes data from the Context object: either a key-value entry or a specific value within an array stored under that key. Parameters:
  • key: string โ€” the key in the Context object.
  • value: string โ€” the value to remove if the mode is set to "array".
  • mode: "simple" | "array":
    • "simple" โ€” deletes a key-value entry.
    • "array" โ€” removes a value from the array.
Returns: void

Example

// Delete a key-value entry
removeFromContext("user.city", "", "simple");

// Remove a specific value from an array
removeFromContext("user.purchases", "book", "array");
โŒ˜I