Created
December 10, 2014 07:09
-
-
Save jotak/527a10b9ca8b123200dc to your computer and use it in GitHub Desktop.
This file contains 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
// Layer interface | |
interface Layer { | |
search: (str: string)=>void; | |
} | |
// File Controller.js | |
function search(str) { | |
var layers: Layer[] = getAllActiveLayers(); | |
layers.forEach(function(layer) { | |
layer.search(str); | |
}); | |
} | |
// File MpdLayer.js | |
class MpdLayer implements Layer { | |
public search(str: string) { | |
// run search str | |
} | |
} | |
// File SpopLayer.js | |
class SpopLayer implements Layer { | |
public search(str: string) { | |
// run search str | |
} | |
} | |
// File GoogleLayer.js | |
class GoogleLayer implements Layer { | |
public search(str: string) { | |
// run search str | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment