Sha256: b933f6ef5d9d229722aa701476228e7e6f0c0afbf33014866e5496c1276698e9
Contents?: true
Size: 452 Bytes
Versions: 23
Compression:
Stored size: 452 Bytes
Contents
'use strict' module.exports = factory // Construct a state `toggler`: a function which inverses `property` in context // based on its current value. // The by `toggler` returned function restores that value. function factory(key, state, ctx) { return enter function enter() { var context = ctx || this var current = context[key] context[key] = !state return exit function exit() { context[key] = current } } }
Version data entries
23 entries across 23 versions & 1 rubygems