snapy-promise

0.1.2 • Public • Published

snapy-promise

Plugin of snapy.

Take a snapshot of a promise - when it resolves or rejects.

{test} = require("snapy")

test((snap) => {
  // simple
  snap({promise: somePromise})
  // {resolved: {{resolvedValue}}}

  // plain
  snap({promise: somePromise, plain:true})
  // {{resolvedValue}}

  // transform promise to obj
  snap({
    obj: {
      someProp: somePromise,
      someOtherProp: someOtherPromise
    },
    promise: "someProp, someOtherProp"
    })
  // {
  //  someProp: {resolved:{{resolvedValue}}}
  //  someOtherProp: {resolved:{{resolvedValue}}}
  // }
})

License

Copyright (c) 2017 Paul Pflugradt Licensed under the MIT license.

/snapy-promise/

    Package Sidebar

    Install

    npm i snapy-promise

    Weekly Downloads

    2

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    5.37 kB

    Total Files

    4

    Last publish

    Collaborators

    • paulpflug