How to use the bindNodeCallback function from rxjs
Find comprehensive JavaScript rxjs.bindNodeCallback code examples handpicked from public code repositorys.
GitHub: thcolin/sensorr
![thcolin profile picture](/thcolin.png?size=40)
123 124 125 126 127 128 129 130 131 132
log('🎟️ ', `Grabbing ${chalk.inverse(release.title)} from ${chalk.gray(release.site)}`) logger.fetch(`🎟️ Grabbing **${release.title}** from **_${release.site}_**`, { context, success: true, release }) return of(null).pipe( mergeMap(() => of(sensorr.config.blackhole).pipe( mergeMap(blackhole => bindNodeCallback(fs.access)(blackhole, fs.constants.W_OK).pipe( map(err => !err), mergeMap(exist => exist ? of(null) : bindNodeCallback(fs.mkdir)(blackhole, { recursive: true })), mergeMap(err => err ? throwError(err) : of(null)), )),
+ 7 other calls in file
64 65 66 67 68 69 70 71 72 73
const RedMatch = app.models.RedMatch const AccessToken = app.models.AccessToken const getLastLoginDateTime = () => ctx.options.currentUser ? Rx.bindNodeCallback(AccessToken.find.bind(AccessToken))({ where: { userId: ctx.data.redUserId, }, order: ['created DESC'],
+ 120 other calls in file
30 31 32 33 34 35 36 37 38 39
}; watchDir(join(__dirname, 'temp')) .pipe( mergeMap(e => Rx.bindNodeCallback(readFile)(e.filename)), retryWhen(errors => Rx.bindNodeCallback(mkdir)('temp') .pipe( //log error message tap(val => console.log(`Creating folder!`)), delayWhen(val => timer(0)),
+ 7 other calls in file
GitHub: caosbad/api
![caosbad profile picture](/caosbad.png?size=40)
41 42 43 44 45 46 47 48 49 50
exports.EmptyError = rxjs.EmptyError; exports.ObjectUnsubscribedError = rxjs.ObjectUnsubscribedError; exports.UnsubscriptionError = rxjs.UnsubscriptionError; exports.TimeoutError = rxjs.TimeoutError; exports.bindCallback = rxjs.bindCallback; exports.bindNodeCallback = rxjs.bindNodeCallback; exports.combineLatest = rxjs.combineLatest; exports.concat = rxjs.concat; exports.defer = rxjs.defer; exports.empty = rxjs.empty;
1 2 3 4 5 6 7 8 9 10
const { bindNodeCallback, of } = require('rxjs') const { map, mapTo, mergeMap } = require('rxjs/operators') const prettier = require('prettier') const readFile = bindNodeCallback(fs.readFile) const writeFile = bindNodeCallback(fs.writeFile) function readContent(path) { return readFile(path, 'utf8').pipe(map(content => ({ path, content }))) }
+ 7 other calls in file