Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
atmin committed Dec 4, 2013
1 parent cbbce14 commit 7a69a7b
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions src/coffee/jtmpl.coffee.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,35 589,6 @@ Walk DOM and setup reactors on model and nodes.



### Functional utilities

Function curry(Function f, AnyType frozenArg1, AnyType frozenArg2, ...)

curry = ->
args = apslice.call(arguments)
->
args2 = apslice.call(arguments)
args[0].apply(@, args.slice(1).concat(args2))

Function compose(Function f, Function g)

compose = (f, g) -> -> f(g.apply(@, apslice.call(arguments)))


### Object utilities

Extend an object with given properties

extend = (obj, props) ->
for k, v of props
obj[k] = v
obj



### Regular expression utilities

String escapeRE(String s)
Expand Down Expand Up @@ -724,33 695,6 @@ Register a callback to handle property change.



void initBindings(Object context, String prop)

Create slots for property value and change reactor functions.
Setter notifies all reactors.

initBindings = (context, prop) ->
if not context["__#{ prop }_bindings"]
Object.defineProperty(context, "__#{ prop }_bindings",
enumerable: false
writable: true
value: []
)
Object.defineProperty(context, "__#{ prop }",
enumerable: false
writable: true
value: context[prop]
)
Object.defineProperty(context, prop,
get: -> this["__#{ prop }"]
set: (val) ->
this["__#{ prop }"] = val
reactor.call(this, val) for reactor in this["__#{ prop }_bindings"]
)



void bindArrayToNodeChildren(Array array, DOMElement node)

Bind an array to DOM node,
Expand Down

0 comments on commit 7a69a7b

Please sign in to comment.