Created
April 5, 2012 00:50
-
-
Save zeekay/2306967 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fn1() {} | |
function fn2() {} | |
function fn3() {} | |
function jsListener(fn) { | |
var interface = { | |
fn1: fn1, | |
fn2: fn2, | |
fn3: fn3 | |
} | |
var f = interface[fn]; | |
if (f) { | |
var args = [].slice.call(arguments, 1); | |
return f.apply(this, args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment