Allow execute to return Promise<Value> or Value#65
Allow execute to return Promise<Value> or Value#65andrerpena merged 1 commit intonubasedev:masterfrom
Conversation
This allows to use async behavior in the execute function like fetching urls from a server.
|
Thanks for your contribution @flexzuu . I assume you tested it and it doesn't break the UI or anything, right? I'll test it tonight too and publish it to NPM. Thanks again. |
|
Yeah i use it in my stuff and it did not break anything. But there came up a thought that there might be a environment where Promise is not defined and the check might fail. Maybe you can check this but i will do a little research as well. |
|
Thanks @flexzuu. I just thought of something else now. I'm not sure but It seems more consistent to me that commands always return a What do you think? I'll think about this tonight too. |
|
yeah would simplify the code to only return Promise but that would mean to introduce a breaking change in the commands api. I dunno it's a tradeof between simple code and breaking the commands api or harder to maintain code and non breaking but complicating the api. Only thing is that i need a distributed version with the promise support in some days (best monday) but i might aswell upload my fork to npm if you need more time. But please let me know so i can start working out how the release process for a fork would look like. |
|
Ok @flexzuu. I'll agree. The reason I didn't publish your change yesterday was because I wanted to think a bit and hear from you. Here's what I'll do: This Saturday (tomorrow) I'll publish a non-breaking 2.* version with your changes in it. But I'll update the readme file stating the commands that don't return Let's follow this plan. Expect a new release on NPM tomorrow. |
|
@andrerpena nice solution you worked out i like it 👍 |
|
Thanks for your kind words and your contribution to this project @flexzuu |
|
Published as part of 2.2.0 |
This allows to use
asyncbehavior in the execute function like fetching urls from a server.