@lyra/mutator
A set of models to make it easier to utilize the powerful real time collaborative features of Lyra
Last updated a year ago by bjoerge .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @lyra/mutator 
SYNC missed versions from official npm registry.

@lyra/mutator

Build Status

Features

  • Lyra flavored jsonpath matching engine with flexible interface that plays well with React
  • An implementation of the mutation operations of Lyra that can be applied to vanilla javascript objects, or through a flexible interface: any weird document representation you may require
  • TODO: A model to track documents as they are mutated both locally and remotely through the real time query feature of Lyra
  • Note: If patch.id doesn't match document._id, the patch will be ignored during apply.

Usage

import {Patcher} from '@lyra/mutator'

const document = {
  _id: 'a1b2c3',
  a: {}
}

const patcher = new Patcher({
  id: 'a1b2c3',
  set: {
    'a.b': 'My new value'
  }
})

console.log(patcher.apply(document))

=> {
  _id: 'a1b2c3',
  a: {
    b: 'My new value'
  }
}

Current Tags

  • 0.3.0                                ...           latest (a year ago)

4 Versions

  • 0.3.0                                ...           a year ago
  • 0.2.5                                ...           2 years ago
  • 0.2.4                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (3)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |