rwait

1.1.4 • Public • Published

rwait

js-standard-style npm downloads

Usage

const r = require('rethinkdbdash')({ host: 'localhost' })
const rwait = require('rwait')(r)

;(async () => {
  try {
    const pending = await rwait({
      db: 'test',
      table: 'test',
      timeout: 2000,
      filter: r.row('new_val')('id').eq('test')
    })

    // some operation that causes a write somewhere else....
    process.nextTick(() => {
      r.db('test').table('test').insert([ { id: 'test', value: 'hello world' } ]).run()
    })

    const value = await pending.value
    console.log('got value', value)
  } catch (err) {
    console.error('error', err)
  }
})()

license

Apache License, Version 2.0

Readme

Keywords

Package Sidebar

Install

npm i rwait

Weekly Downloads

0

Version

1.1.4

License

Apache-2.0

Unpacked Size

13.6 kB

Total Files

4

Last publish

Collaborators

  • jameskyburz