emilygilberts commented on PR #9177:
URL: https://github.com/apache/pouchdb/pull/9177#issuecomment-4083937874

   I just rewrote the `defaultsTo` function that sets a default value if a 
promise throws a 404 error - which used to fit neatly into the 
`.catch(defaultsTo(x).then(..) `syntax, but couldn't be used anymore after the 
rewrite. I added an optional `property` parameter to the function, as we 
sometimes want to return the awaited result directly (ex. `lastSeqDoc` in 
`saveKeyValues`) and sometimes a property of it (ex. `purqueSeq._rev` in 
`updatePurgeSeq`). This part was most confusing for me - so I'm happy for any 
thoughts on it! :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to