Version: dev

remove_reaction

Stable function · Editing

Tier: stable · Kind: function · Topic: Editing

JuliaTypeScriptPythonRustGo
remove_reactionremoveReactionremove_reaction, remove_reaction_from_systemremove_reactionRemoveReaction

Note: spelling differs from the §2 rule: python=remove_reaction_from_system (expected remove_reaction); multiple spellings exported by: python

Julia

remove_reaction(system::ReactionSystem, id::String)
remove_reaction(system::ReactionSystem, id::String) -> ReactionSystem

Remove a reaction by its ID.

Throws EditError if no reaction has the given ID.

Source

TypeScript

function removeReaction(system: ReactionSystem, id: string): ReactionSystem

Remove a reaction from a reaction system

Parameters

  • system — ReactionSystem to remove reaction from
  • id — Reaction ID to remove

Returns

New reaction system with reaction removed

Throws

  • EntityNotFoundError if reaction not found

Source

Python

Exported as remove_reaction and remove_reaction_from_system. Both names refer to the same operation.

remove_reaction

remove_reaction(reaction_system: ReactionSystem, reaction_name: str, validate_after_edit: bool = True) -> EditResult

Remove a reaction from a reaction system.

Source

remove_reaction_from_system

remove_reaction_from_system(reaction_system: ReactionSystem, reaction_name: str, validate_after_edit: bool = True) -> EditResult

Deprecated alias for remove_reaction . Remove a reaction from a reaction system.

Source

Rust

pub fn remove_reaction(system: &ReactionSystem, index: usize) -> EditResult<ReactionSystem>

Remove a reaction from a reaction system by index

Arguments

  • system - The reaction system to modify
  • index - Index of the reaction to remove

Returns

  • EditResult<ReactionSystem> - New reaction system without the reaction

Source · Rust docs

Go

func RemoveReaction(system ReactionSystem, id string) (ReactionSystem, error)

RemoveReaction returns a copy of system without the reaction whose ID is id.

Returns *EntityNotFoundError when no reaction has that ID, and *EditError (invalid_operation) when the removal would empty the system: the schema requires a reaction system to retain at least one reaction, so the sole remaining reaction is still required.

Source · Go docs