Given a named function utilized to handle a Promise
value
function handlePromise(data) {
// do stuff with `data`
return data
}
There is indeed one main difference though not so important, which actually should be avoided.
If you call handlePromise() as directly inside then() you're not allowed to add external parameters. If you call it inside function which is inside then .then( (result) => handle(result, someOtherParam) )
then you're able to add 'someotherparam' to call. It's handy if you have bigger calls tree, though I would avoid that and pass it through whole promises chain.
TLDR; first one is called with .then() results as parameters, latter one is elastic in what you want to pass further.