UNPKG

@danielkalen/simplybind

Version:

Magically simple, framework-less one-way/two-way data binding for frontend/backend in ~5kb.

32 lines (23 loc) 626 B
new TestSuite 'title': 'Div HTML Update' 'subtitle': 'Update the content of a div 10,000 times' 'measureMethod': 'sync' 'warmUps': 10000 'timesToRun': 10000 'setupFn': (container$)-> @obj = 'prop':'value' @div$ = $('<div />') currentValue = 0 SimplyBind('prop').of(@obj) .to('innerHTML').of(@div$) @getNewValue = ()-> "value#{currentValue++}" container$.append @div$ return 'teardownFn': (container$)-> container$.empty() SimplyBind.unBindAll(@obj, true) SimplyBind.unBindAll(@div$, true) delete @obj delete @div$ delete @getNewValue 'testFn': ()-> @obj.prop = @getNewValue()