-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/develop'
- Loading branch information
Showing
12 changed files
with
261 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) |
Oops, something went wrong.