How to use the bindNodeCallback function from rxjs

Find comprehensive JavaScript rxjs.bindNodeCallback code examples handpicked from public code repositorys.

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)),
    )),
fork icon6
star icon98
watch icon0

+ 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'],
fork icon7
star icon18
watch icon6

+ 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)),
fork icon0
star icon11
watch icon3

+ 7 other calls in file

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;
fork icon299
star icon0
watch icon1

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 })))
}
fork icon0
star icon0
watch icon1

+ 7 other calls in file