Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add possibility to transform/map binded values #30

Closed
kkolman opened this issue Feb 14, 2012 · 3 comments
Closed

add possibility to transform/map binded values #30

kkolman opened this issue Feb 14, 2012 · 3 comments

Comments

@kkolman
Copy link

kkolman commented Feb 14, 2012

How about adding support for calling functions on binded values ?

I can think of having the "with" method as in:

map.class('snippet').with(toUpper).to('val');

or

map.class('snippet').with(function(val) { val == null ? 'i'm not here' : val}).to('val');

see bae1fae for an example implementation

@tauren
Copy link
Contributor

tauren commented Feb 15, 2012

+1 This is similar to what I suggested in #29

@kkolman
Copy link
Author

kkolman commented Feb 15, 2012

yep, what you're suggesting is more advanced and flexible

just adding that my branch uses the "with" method which is a reservd keyword also (as is class) in JS/ECMAscript

@3rd-Eden
Copy link
Member

Closing this, you can now do:

var map = new plates.Map();
map.className('pewpew').use(function render(data, value, tagbody) {
 return 'pewpew' + data.pewpew + value;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants