# When will someone recreate some P5 functions with PROMISES

**URL:** <https://discourse.processing.org/t/when-will-someone-recreate-some-p5-functions-with-promises/34555>\
**Category:** Libraries\
**Created:** [January 10, 2022, 4:37am UTC](https://discourse.processing.org/t/when-will-someone-recreate-some-p5-functions-with-promises/34555 "2022-01-10T04:37:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Errorbot1122](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/errorbot1122/32/14718_2.png) [@Errorbot1122](https://discourse.processing.org/u/Errorbot1122)\
**Post date:** [January 10, 2022, 4:37am UTC](https://discourse.processing.org/t/when-will-someone-recreate-some-p5-functions-with-promises/34555/1 "2022-01-10T04:37:14Z")

</div>

**Promises** are almost always better than callbacks, so can someone replace almost all callbacks with Promises.

Adding promises would actually shorten the functions by removing the error, and success callbacks, converting `loadImage('test.png', success, err)` to `loadImage('test.png')`

**ALSO,** I feel like that should keep the `whileLoading` callbacks, or any other repeated callback since those are needed and may not even work for promises! _(It would be really cool if you could send values while a promise was pending, so you could send the percentage that a file has loaded in before it was finished or something. like that… )_
