Skip to content

Commit fbebf97

Browse files
author
Vlad Balin
committed
Merge remote-tracking branch 'refs/remotes/origin/develop'
2 parents d6a9f58 + 5d593e0 commit fbebf97

File tree

12 files changed

+261
-156
lines changed

12 files changed

+261
-156
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
master: [![Master Build Status](https://travis-ci.org/Volicon/backbone.nestedTypes.svg?branch=master)](https://travis-ci.org/Volicon/backbone.nestedTypes)
44
develop: [![Develop Build Status](https://travis-ci.org/Volicon/backbone.nestedTypes.svg?branch=develop)](https://travis-ci.org/Volicon/backbone.nestedTypes)
55

6-
Version 1.1.5 highlights:
6+
Version 1.2.0 highlights:
77

8+
- React integration and data binding support. [npm install nestedreact](https://github.com/Volicon/react-backbone.glue/)
89
- Fixed incompatibilities with backbone 1.2.x by removing backbone dependency, effective now and forever. Currently, stable backbone 1.1.2 is linked in.
910
- npm package name is changed to just 'nestedtypes'. Thus, `npm install nestedtypes`.
1011
- Can be used as drop-in backbonejs replacement in your project.
Lines changed: 10 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,25 @@
11
(!) UNIVERSAL DATABINDING (!)
2-
2+
Based in react links
33

44

55
// for boolean
6-
collection.toggler( model )
7-
get : m in collection
8-
set( true )
6+
collection.lhas( model )
97

108
{ encoders.map( encoder => (
11-
<Checklist checked={ selected.toggler( encoder ) } />
9+
<Checklist key={ encoder.cid } checkedLink={ selected.lhas( encoder ) } />
1210
))}
1311

1412
// for inputs
15-
model.bind.attr
13+
model.lget( 'attr' )
1614

1715
// for radio
18-
model.bound.selected.eql( x )
19-
get : a === x,
20-
set( true ) : a = x
21-
set( false ): a = null
16+
model.lget( 'selected' ).leql( x )
2217

2318
// for clicks
24-
model.setter.selected.to( x )
25-
get : a = x
26-
27-
model.setter.selected.toggle( y )
28-
29-
30-
model.setter( 'attr', x )
31-
model.setter( 'attr' )
32-
model.toggler( 'attr', x )
33-
34-
35-
function to( x ){
36-
var setter = this;
37-
return function(){ setter( x ); }
38-
}
39-
40-
function toggle( x ){
41-
var setter = this;
42-
return function( y ){
43-
,,,,
44-
return setter() === y;
45-
}
46-
}
47-
48-
makeSetter( self, name ){
49-
var f = function( x ){
50-
return arguments.length ? self[ name ] = x : self[ name ];
51-
};
52-
53-
f.to = to;
54-
}
55-
56-
setter : function(){
57-
if( this._setters )
58-
var setters = {}, self = this;
59-
for( var name in this.attributes ){
60-
setters[ name ] = makeSetter( name );
61-
}
62-
63-
return setters;
64-
}
19+
model.fset( 'selected', x )
20+
model.lget( 'selected' ).leql( 'y' ).fset( true )
6521

66-
function( x ){
6722

68-
}
23+
model.fset( 'attr', x )
24+
model.lget( 'attr' )
25+
model.lget( 'attr' ).leql( x )

0 commit comments

Comments
 (0)