Sha256: 3c31486e3891efc6a4cd65f218f03762b33ed039aa99b18ea81f625bb0b02714
Contents?: true
Size: 397 Bytes
Versions: 5
Compression:
Stored size: 397 Bytes
Contents
slices.HOOKS = {}; /* * Register a slices hook function. * * @param {String} key * @param {Function} fun */ slices.on = function(key, fun) { slices.HOOKS[key] = slices.HOOKS[key] || []; slices.HOOKS[key].push(fun); }; /* * Trigger hooks for key. * * @param {String} key */ slices.trigger = function(key) { var hooks = slices.HOOKS[key]; if (hooks) _.invoke(hooks, 'call'); };
Version data entries
5 entries across 5 versions & 1 rubygems