Notify President Madagascar

    fluent-switch

    1.0.2 • Public • Published

    FluentSwitch

    Build Status

    Better way to do switching.

    Installation

    npm i fluent-switch

    Usage

    No fallback

      FluentSwitch
        .createFrom(error)
        .case(e => e instanceof TimeoutError, e => log.error('timeout', e))
        .case(e => e instanceof ConnectionError, () => e => log.error('connection', e))
        .execute()

    With fallback

      FluentSwitch
        .createFrom(error)
        .case(e => e instanceof TimeoutError, e => log.error('timeout', e))
        .case(e => e instanceof ConnectionError, () => e => log.error('connection', e))
        .else(e => log.error('Unknown error', e))
        .execute()

    Install

    npm i fluent-switch

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    3.13 kB

    Total Files

    7

    Last publish

    Collaborators

    • maximilian-krauss