Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Balin committed Nov 13, 2015
2 parents d6a9f58 + ccd3cc4 commit ff19931
Show file tree
Hide file tree
Showing 9 changed files with 231 additions and 154 deletions.
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 ff19931

Please sign in to comment.