# Add or update function?

**URL:** <https://forum.elixirforum.com/t/add-or-update-function/61465>\
**Category:** Questions\
**Tags:** ecsx\
**Created:** [February 5, 2024, 5:56pm UTC](https://forum.elixirforum.com/t/add-or-update-function/61465 "2024-02-05T17:56:50Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![APB9785](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/apb9785/32/24101_2.png) [@APB9785](https://forum.elixirforum.com/u/APB9785)\
**Post date:** [February 5, 2024, 9:30pm UTC](https://forum.elixirforum.com/t/add-or-update-function/61465/9 "2024-02-05T21:30:35Z")

</div>

> Also, right now the current API doesn’t let them change the options of an existing entity at all

This isn’t guaranteed to be the case forever.

> so you wouldn’t lose any functionality with an `add` that just left the opts as-is for an existing entity when the caller left them off… if they wanted the opts updated on an existing entity, they’d provide the opts, which would be additional functionality.

If the default functionality is “keep the existing value” then it doesn’t work for creating new components (because there is no existing value yet). And we cannot have two different default functionalities for the same function, based on a runtime conditional. That would be very bad.

---

_[View the full topic](https://forum.elixirforum.com/t/add-or-update-function/61465)._
