Skip to content

Instantly share code, notes, and snippets.

View petebacondarwin's full-sized avatar

Pete Bacon Darwin petebacondarwin

View GitHub Profile
@ThomasBurleson
ThomasBurleson / docSearcher.js
Last active August 29, 2015 14:10
Enhanced version of `docSearcher` webWorker discussed in Pete Darwin's blog [AngularJS Docs Performance](http://www.bacondarwin.co.uk/angularjs-docs-performance/)
angular.module('search', [])
.service('docsSearch', ['$q','$rootScope','$timeout','NG_PAGES',BackgroundSearchService]);
/**
* Document search service that uses Web Workers to index
* and search in the background.
*/
function BackgroundSearchService($q, $rootScope, $timeout, NG_PAGES) {
console.log('Using WebWorker Search Index');