-
Notifications
You must be signed in to change notification settings - Fork 0
API Object
cloneObject : Object -> Object
x : Object
return : Object
Returns a copy of x.
extend : Object -> Object -> Object
x : Object
y : Object
return : Object
Returns an object that has all the keys/values of both x and y. If x and y have the same key then it will use y's value.
lookup : String -> Object -> Maybe a
propertyName : String
obj : Object
return : Maybe
Accesses the specified property of the object. If propertyName is a valid property on obj this returns [Just](API Maybe) the value of the property; otherwise it returns [Nothing](API Maybe).
tlc.lookup("one", {one: 1}); // Just 1
tlc.lookup("two", {one: 1}); // Nothingprop : String -> Object -> a
propertyName : String
obj : Object
return : Any
Accesses the specified property of the object. This is an unsafe version of tlc.lookup so use it only when the property must exist. tlc.prop(propertyName, obj) is equivalent to obj[propertyName].
If you have an array of DOM elements, xs, and you want to get their offset widths you can do the following.
tlc.map(tlc.prop("offsetWidth"), xs); // [132, 493, ...]propCall : String -> [a] -> Object -> b
propertyName : String
args : Array
obj : Object
return : Any
Calls the specified property of the object. tlc.propCall(propertyName, [arg1, arg2, ...], obj) is equivalent to obj[propertyName](arg1, arg2, ...).
If you have an array of DOM elements, xs, and you want to get only the ones that have children, you can do the following.
tlc.filter(tlc.propCall("hasChildNodes", []), xs);