Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Balin committed Nov 17, 2015
2 parents d6a9f58 + 5d593e0 commit fbebf97
Show file tree
Hide file tree
Showing 12 changed files with 261 additions and 156 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
master: [![Master Build Status](https://travis-ci.org/Volicon/backbone.nestedTypes.svg?branch=master)](https://travis-ci.org/Volicon/backbone.nestedTypes)
develop: [![Develop Build Status](https://travis-ci.org/Volicon/backbone.nestedTypes.svg?branch=develop)](https://travis-ci.org/Volicon/backbone.nestedTypes)

Version 1.1.5 highlights:
Version 1.2.0 highlights:

- React integration and data binding support. [npm install nestedreact](https://github.com/Volicon/react-backbone.glue/)
- Fixed incompatibilities with backbone 1.2.x by removing backbone dependency, effective now and forever. Currently, stable backbone 1.1.2 is linked in.
- npm package name is changed to just 'nestedtypes'. Thus, `npm install nestedtypes`.
- Can be used as drop-in backbonejs replacement in your project.
Expand Down
63 changes: 10 additions & 53 deletions docs/universal databinding proposal.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,25 @@
(!) UNIVERSAL DATABINDING (!)

Based in react links


// for boolean
collection.toggler( model )
get : m in collection
set( true )
collection.lhas( model )

{ encoders.map( encoder => (
<Checklist checked={ selected.toggler( encoder ) } />
<Checklist key={ encoder.cid } checkedLink={ selected.lhas( encoder ) } />
))}

// for inputs
model.bind.attr
model.lget( 'attr' )

// for radio
model.bound.selected.eql( x )
get : a === x,
set( true ) : a = x
set( false ): a = null
model.lget( 'selected' ).leql( x )

// for clicks
model.setter.selected.to( x )
get : a = x

model.setter.selected.toggle( y )


model.setter( 'attr', x )
model.setter( 'attr' )
model.toggler( 'attr', x )


function to( x ){
var setter = this;
return function(){ setter( x ); }
}

function toggle( x ){
var setter = this;
return function( y ){
,,,,
return setter() === y;
}
}

makeSetter( self, name ){
var f = function( x ){
return arguments.length ? self[ name ] = x : self[ name ];
};

f.to = to;
}

setter : function(){
if( this._setters )
var setters = {}, self = this;
for( var name in this.attributes ){
setters[ name ] = makeSetter( name );
}

return setters;
}
model.fset( 'selected', x )
model.lget( 'selected' ).leql( 'y' ).fset( true )

function( x ){

}
model.fset( 'attr', x )
model.lget( 'attr' )
model.lget( 'attr' ).leql( x )
Loading

0 comments on commit fbebf97

Please sign in to comment.