Last active
December 12, 2015 01:48
-
-
Save Inviz/4693368 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
[submodule "color"] | |
path = color | |
url = https://github.com/kamicane/mootools-color | |
[submodule "lsd-specs"] | |
path = lsd-specs | |
url = https://github.com/lovelyscalabledrawings/lsd-specs | |
[submodule "lsd"] | |
path = lsd | |
url = https://github.com/lovelyscalabledrawings/lsd | |
[submodule "Sheet.js"] | |
path = Sheet.js | |
url = https://github.com/lovelyscalabledrawings/Sheet.js | |
[submodule "slick"] | |
path = slick | |
url = https://github.com/lovelyscalabledrawings/slick | |
[submodule "inflections"] | |
path = inflections | |
url = https://github.com/lovelyscalabledrawings/mootools-string-inflections.git |
This file contains hidden or 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
git submodule init | |
git submodule update | |
cd lsd-specs | |
./compile.sh | |
open Runner/index.html | |
This file contains hidden or 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
var o = new LSD.Object({a: 1}); | |
o.watch('a', function(value, old) {}) | |
//fires callback with 1, undefined | |
o.set('a', 2); | |
// fires callback with 2, 1 | |
var a = new LSD.Object; | |
a.merge(o) | |
// live merge objects | |
// a.a => 2 | |
a.unmerge(o); | |
// a.a => undefined | |
o.unset('a') | |
// fires callback with undefined, 2 | |
// a.a => undefined | |
This file contains hidden or 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
var Widget = new Struct({ | |
id: function(value, old) { | |
// transform value | |
if (value) | |
return value + 1; | |
}, | |
name: function(value, old) { | |
this.set('id', value, old) // all modifications to name passed to id | |
}, | |
title: 'alt', //redirect title -> alt | |
}) | |
var widget = new Widget; | |
widget.set('name', 'Hey'); | |
widget.id //Hey1 | |
widget.unset('name') | |
widget.id //undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment