GithubHelp home page GithubHelp logo

ember-sync's Introduction

Datamapper

Mapping Ember.js objects to a Racer model. Modifications are handled back and forth once the bindings are declared.

Racer: https://github.com/codeparty/racer

Ember: https://github.com/emberjs/ember.js

Two main methods:

DM.linkCollection

Map an Ember collection (array or custom class) to a racer path.

DM.linkCollection(emColl, racerPath, racerModel, [type])

  • emColl Ember collection that should be synchronized
  • racerPath Racer path that directs to the collection that should be mapped
  • racerModel racer.model object
  • type Ember class for the objects represented in the collection. Defaults to DM.Object

DM.linkObject

Map a single Ember object to a Racer path.

DM.linkObject(emObject, racerPath, racerModel, attrs, type)

  • emObject Address to the Ember object that should be synchronized
  • racerPath Racer path that directs to the object that should be mapped
  • racerModel racer.model object
  • attrs List of attributes that should be observed for changes.
  • type Ember class for the synchronized object. Defaults to DM.Object.

Your model classes are required to extend DM.Object instead of Ember.Object.

Collections can be represented using the Ember Array. If you're using a custom collection type, make sure it implements Ember.MutableEnumerable and that addObject and removeObject have a "silent" param. If silent evaluates to true, observers should not be notified of the change.

ember-sync's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

michiel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.