How to use the rambdax.values function in rambdax

To help you get started, we’ve selected a few rambdax examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Nozbe / WatermelonDB / src / adapters / lokijs / worker / executor.js View on Github external
_setUpSchema(): void {
    logger.log('[DB][Worker] Setting up schema')

    // Add collections
    values(this.schema.tables).forEach(tableSchema => {
      this._addCollection(tableSchema)
    })

    this.loki.addCollection('local_storage', {
      unique: ['key'],
      indices: [],
      disableMeta: true,
    })

    // Set database version
    this._databaseVersion = this.schema.version

    logger.log('[DB][Worker] Database collections set up')
  }
github Nozbe / WatermelonDB / src / RawRecord / index.js View on Github external
// This is called with `{}` when making a new record, so we need to set a new ID, status
  // Also: If an existing has one of those fields broken, we're screwed. Safest to treat it as a
  // new record (so that it gets synced)
  const raw = {}

  if (typeof id === 'string') {
    raw.id = id
    raw._status = isValidStatus(_status) ? _status : 'created'
    raw._changed = typeof _changed === 'string' ? _changed : ''
  } else {
    raw.id = randomId()
    raw._status = 'created'
    raw._changed = ''
  }

  values(tableSchema.columns).forEach(columnSchema => {
    const key = (columnSchema.name: string)
    const value = dirtyRaw[key]
    _setRaw(raw, key, value, columnSchema)
  })

  return raw
}
github Nozbe / WatermelonDB / src / Database / index.js View on Github external
_unsafeClearCaches(): void {
    values(this.collections.map).forEach(collection => {
      collection.unsafeClearCache()
    })
  }
github Nozbe / WatermelonDB / src / adapters / sqlite / encodeInsert / index.js View on Github external
export default function encodeInsert(model: Model): SQLiteQuery {
  const { _raw: raw, table } = model
  const sql = `insert into ${table} (${columnNames(raw)}) values (${valuePlaceholders(raw)})`
  const args = values(raw)

  return [sql, args]
}
github Nozbe / WatermelonDB / src / adapters / sqlite / encodeSchema / index.js View on Github external
export const encodeSchema: AppSchema => SQL = ({ tables }) =>
  values(tables)
    .map(encodeTable)
    .join('')
github Nozbe / WatermelonDB / src / observation / subscribeToQueryWithColumns / index.js View on Github external
const recordStatesEqual = (left: RecordState, right: RecordState): boolean =>
  identicalArrays(values(left), values(right))