Skip to content

Commit ff19931

Browse files
author
Vlad Balin
committed
Merge branch 'develop'
2 parents d6a9f58 + ccd3cc4 commit ff19931

File tree

9 files changed

+231
-154
lines changed

9 files changed

+231
-154
lines changed
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)