Skip to content

v0.2.1

Latest

Choose a tag to compare

@timomeh timomeh released this 15 Jun 20:38
  • Unwraps Action.handle result in Action.invoke
import { Vla } from 'vla'

class ActionPacked extends Vla.Action {
  async handle() {
    await wait(100)

    return { success: true }
  }
}

// Before: nested promise 🥺
const result = ActionPacked.invoke()
//    ^^^^^^
// const result: Promise<Promise<{
//     success: boolean;
// }>>

// After: flattened promise 📈
const result = ActionPacked.invoke()
//    ^^^^^^
// const result: Promise<{
//     success: boolean;
// }>

Full Changelog: v0.2.0...v0.2.1