Alex A. Naanou 21a343b5d2 started work on docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2022-07-06 00:23:18 +03:00
2022-07-05 22:29:13 +03:00
2022-07-05 23:14:09 +03:00
2022-07-06 00:23:18 +03:00
2022-07-05 23:14:09 +03:00

stoppable.js

Utility library implementing tooling to make stoppable functions...

$ npm install --save ig-stoppable
var stoppable = require('ig-stoppable')
var func = stoppable(function(){
    // ...

    throw stoppable.STOP('something')

    // ...
})

var value = func() // -> 'something'
var gen = stoppable(function*(){
    // ...

    throw stoppable.STOP('something')

    // ...
})

var value = [...gen()] // -> ['somthing']
var agen = stoppable(async function*(){
    // ...

    throw stoppable.STOP('something')

    // ...
})

var value = awat agen() // -> ['something']
Description
Utility library implementing tooling to make stoppable functions...
Readme BSD-3-Clause 41 KiB
Languages
JavaScript 100%