jstransformer icon indicating copy to clipboard operation
jstransformer copied to clipboard

async/await

Open RobLoach opened this issue 8 years ago • 3 comments

Add docs on how to use this with async/await.

RobLoach avatar Jan 16 '17 22:01 RobLoach

:question: Confused what you are asking for :confused:

Do we have to change our implementations at all for JSTransformers to be compatible with async/await?

calebeby avatar Jan 17 '17 02:01 calebeby

@calebeby no. @RobLoach is talking about that we should make a note for users for the *Async methods that they can use it with combination with async/await syntax.

var md = require('jstrasformer')(require('jstransformer-marked')

async function myAsyncFn () {
  const res = await md.renderAsync('some md')
  console.log(res.body)
}

I believe :)

tunnckoCore avatar Jan 17 '17 05:01 tunnckoCore

Ah. Ok

On Mon, Jan 16, 2017 at 9:09 PM, Charlike Mike Reagent < [email protected]> wrote:

@calebeby https://github.com/calebeby no. @RobLoach https://github.com/RobLoach is talking about that we should make a note for users for the *Async methods that they can use it with combination with async/await syntax.

var md = require('jstrasformer')(require('jstransformer-marked') async function myAsyncFn () { await md.renderAsync('some md') }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jstransformers/jstransformer/issues/191#issuecomment-273024000, or mute the thread https://github.com/notifications/unsubscribe-auth/AMmFoQtmGv0LELr4w737bwBahcZnHwT_ks5rTEzxgaJpZM4LlDOQ .

calebeby avatar Jan 17 '17 05:01 calebeby