UNPKG

@danielkalen/simplybind

Version:

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

39 lines (23 loc) 918 B
Object.defineProperties SimplyBind, 'version': value: import '../../.config/.version.coffee' 'options': get: ()-> clonedOptions = {} clonedOptions[key] = value for key,value of globalOptions return clonedOptions SimplyBind.setOption = (option, newValue)-> if checkIf.isDefined(globalOptions[option]) globalOptions[option] = newValue setPholderRegEx() if option is 'placeholder' return SimplyBind.setOptions = (newOptions)-> for option,value of newOptions SimplyBind.setOption(option, value) return SimplyBind.unBindAll = (object, bothWays)-> if object and (checkIf.isObject(object) or checkIf.isFunction(object)) import [browserOnly] SimplyBind-unBindAll.parseDOMObject.coffee propMap = object._sb_map if object._sb_ID boundInstances[object._sb_ID].removeAllDeps(bothWays) if propMap boundInstances[boundID].removeAllDeps(bothWays) for prop, boundID of propMap return