remove_reaction
Stable function · Editing
Tier: stable · Kind: function · Topic: Editing
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
remove_reaction | removeReaction | remove_reaction, remove_reaction_from_system | remove_reaction | RemoveReaction |
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.
TypeScript
function removeReaction(system: ReactionSystem, id: string): ReactionSystem
Remove a reaction from a reaction system
Parameters
system— ReactionSystem to remove reaction fromid— Reaction ID to remove
Returns
New reaction system with reaction removed
Throws
- EntityNotFoundError if reaction not found
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.
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.
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 modifyindex- Index of the reaction to remove
Returns
EditResult<ReactionSystem>- New reaction system without the reaction
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.