Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
update-transla…
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
const callAction = (inject, module, action, ...args) => inject.module(module).action(action, ...args);
const createModuleWrapper = (inject, module, actions) =>
actions.reduce((all, action) =>
({ ...all, [action]: callAction.bind(null, inject, module, action) }), {});
export default class Cliqz {
constructor(inject) {
this.mobileCards = createModuleWrapper(inject, 'mobile-cards', [
'openLink',
'callNumber',
'openMap',
'hideKeyboard',
'sendUIReadySignal',
'handleAutocompletion',
'getConfig',
'getTrackerDetails',
]);
this.core = createModuleWrapper(inject, 'core', []);
this.search = createModuleWrapper(inject, 'search', ['getSnippet', 'reportHighlight']);
this.geolocation = createModuleWrapper(inject, 'geolocation', ['updateGeoLocation']);
}
}