@danielkalen/simplybind
Version:
Magically simple, framework-less one-way/two-way data binding for frontend/backend in ~5kb.
32 lines (24 loc) • 726 B
text/coffeescript
new TestSuite
'title': 'Input Transform'
'subtitle': 'Update the value of an input field 10,000 times and apply a transform function'
'measureMethod': 'sync'
'warmUps': 10000
'timesToRun': 10000
'setupFn': (container$)->
= 'prop':'value'
= $('<input type="text">')
currentValue = 0
SimplyBind('prop').of()
.to('value').of()
.transform (value)-> value.toUpperCase()
= ()-> "value#{currentValue++}"
container$.append
return
'teardownFn': (container$)->
container$.empty()
SimplyBind.unBindAll(, true)
SimplyBind.unBindAll(, true)
delete
delete
delete
'testFn': ()-> .prop = ()