Skip to content

Unsafe mode #19

Description

@TwitchBronBron

Add an "unsafe" mode for promise observers where the internal try/catch is bypassed. It could look something like this:

  1. Make a new namespace called unsafe to house these functions
promises.unsafe.onThen()
promises.unsafe.onCatch()
promises.unsafe.onFinally()
promises.unsafe.chain()
  1. Add .unsafe() and .safe() to promises.chain() and promises.unsafe.chain() which flip the safety switch for that observer. Something like this:
promises.chain(somePromise).then(function()
    'i am safe
end function).unsafe().then(function()
    'i am unsafe
end function).then(function()
    'i am unsafe
end function).safe().then(function()
    'i am safe
end function)
  1. promises.unsafe.chain() and promises.safe.chain() are the same implementation, except the .unsafe one starts the chain with .unsafe mode enabled by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions