mesg-foundation / js-sdk

Javascript mono-repo with all the tools to interact with MESG
https://mesg.com
4 stars 4 forks source link

Accept function as well as a task object #81

Closed NicolasMahe closed 4 years ago

NicolasMahe commented 6 years ago

https://github.com/mesg-foundation/mesg-js/blob/29a38ce83b8674258b5df6102d1c99f556c5c4fd/lib/application/execute.js#L3

Here, we could replace { serviceID, taskKey, inputs } by task and test if it a function. If it a function, simply call it, otherwise, keep the same current behavior.

antho1404 commented 6 years ago

This could be good for debug but I think that's the only use case because if it's a function and it has do to something special then create a service. Also if you really want to debug you can always use the inputs function. In general I really want to push people to create services it will be better like that it's a really separated code and it really simplify the application to something really simple and easy to understand

NicolasMahe commented 6 years ago

Close because of mesg-foundation/js-sdk#77