destroy
Removes a property from an interaction object using a dot-notation key path.
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.destroy(key)
Or import directly the specific function:
_10import { destroy } from "@onflow/sdk"_10_10destroy(key)
Usage
_16import { destroy, put, get, initInteraction } from "@onflow/sdk"_16_16const interaction = initInteraction();_16_16// Set some values_16put("user.name", "Alice")(interaction);_16put("user.email", "alice@example.com")(interaction);_16put("user.temp", "temporary data")(interaction);_16_16console.log(get(interaction, "user.temp")); // "temporary data"_16_16// Remove temporary data_16destroy("user.temp")(interaction);_16_16console.log(get(interaction, "user.temp")); // undefined_16console.log(get(interaction, "user.name")); // "Alice" (still exists)
Parameters
key
- Type:
string
- Description: The dot-notation key path to remove
Returns
function