jstransformers / jstransformer

Normalize the API of any JSTransformer.
http://npm.im/jstransformer
MIT License
153 stars 12 forks source link

async/await #191

Open RobLoach opened 7 years ago

RobLoach commented 7 years ago

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

calebeby commented 7 years ago

: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?

tunnckoCore commented 7 years ago

@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 :)

calebeby commented 7 years ago

Ah. Ok

On Mon, Jan 16, 2017 at 9:09 PM, Charlike Mike Reagent < notifications@github.com> 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 .