forked from algolia/instantsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.es6.js
33 lines (28 loc) · 1.08 KB
/
index.es6.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* eslint max-len: 0 */
import algoliasearchHelper from 'algoliasearch-helper';
import toFactory from 'to-factory';
import InstantSearch from './lib/InstantSearch.js';
import version from './lib/version.js';
// import instantsearch from 'instantsearch.js';
// -> provides instantsearch object without connectors and widgets
const instantSearchFactory = Object.assign(toFactory(InstantSearch), {
version,
createQueryString: algoliasearchHelper.url.getQueryStringFromState,
});
Object.defineProperty(instantSearchFactory, 'widgets', {
get() {
throw new ReferenceError(`
You can't access to 'instantsearch.widgets' directly from the ES6 build.
Import the widgets this way 'import {SearchBox} from "instantsearch.js/widgets"'
`);
},
});
Object.defineProperty(instantSearchFactory, 'connectors', {
get() {
throw new ReferenceError(`
You can't access to 'instantsearch.connectors' directly from the ES6 build.
Import the connectors this way 'import {connectSearchBox} from "instantsearch.js/connectors"'
`);
},
});
export default instantSearchFactory;