@@ -6,15 +6,14 @@ import Appbase from 'appbase-js';
66import AppbaseAnalytics from '@appbaseio/analytics' ;
77import 'url-search-params-polyfill' ;
88import { createCache } from '@appbaseio/vue-emotion' ;
9- import { defineComponent } from 'vue' ;
109import Provider from '../Provider' ;
1110import { composeThemeObject , X_SEARCH_CLIENT } from '../../utils/index' ;
1211import types from '../../utils/vueTypes' ;
1312import URLParamsProvider from '../URLParamsProvider.jsx' ;
1413import getTheme from '../../styles/theme' ;
1514
1615const { setValues } = Actions ;
17- const ReactiveBase = defineComponent ( {
16+ const ReactiveBase = {
1817 name : 'ReactiveBase' ,
1918 data ( ) {
2019 this . state = {
@@ -110,10 +109,10 @@ const ReactiveBase =defineComponent( {
110109 ...( enableTelemetry === false && { 'X-Enable-Telemetry' : false } ) ,
111110 } ) ,
112111 ...headers ,
113- ...( endpoint
114- && endpoint . headers && {
115- ...endpoint . headers ,
116- } ) ,
112+ ...( endpoint &&
113+ endpoint . headers && {
114+ ...endpoint . headers ,
115+ } ) ,
117116 } ;
118117 } ,
119118 } ,
@@ -123,8 +122,8 @@ const ReactiveBase =defineComponent( {
123122 this . key = `${ this . state . key } -0` ;
124123 } ,
125124 setStore ( props ) {
126- const credentials
127- = props . url && props . url . trim ( ) !== '' && ! props . credentials
125+ const credentials =
126+ props . url && props . url . trim ( ) !== '' && ! props . credentials
128127 ? null
129128 : props . credentials ;
130129 let url = props . url && props . url . trim ( ) !== '' ? props . url : '' ;
@@ -209,8 +208,8 @@ const ReactiveBase =defineComponent( {
209208 // When endpoint prop is used index is not defined, so we use _default
210209 index : appbaseRef . app || '_default' ,
211210 globalCustomEvents :
212- this . $props . reactivesearchAPIConfig
213- && this . $props . reactivesearchAPIConfig . customEvents ,
211+ this . $props . reactivesearchAPIConfig &&
212+ this . $props . reactivesearchAPIConfig . customEvents ,
214213 } ;
215214
216215 try {
@@ -220,13 +219,13 @@ const ReactiveBase =defineComponent( {
220219 / \/ \/ ( .* ?) \/ .* / ,
221220 '//$1' ,
222221 ) ;
223- const headerCredentials
224- = this . $props . endpoint . headers && this . $props . endpoint . headers . Authorization ;
225- analyticsInitConfig . credentials
226- = headerCredentials && headerCredentials . replace ( 'Basic ' , '' ) ;
222+ const headerCredentials =
223+ this . $props . endpoint . headers && this . $props . endpoint . headers . Authorization ;
224+ analyticsInitConfig . credentials =
225+ headerCredentials && headerCredentials . replace ( 'Basic ' , '' ) ;
227226 // Decode the credentials
228- analyticsInitConfig . credentials
229- = analyticsInitConfig . credentials && atob ( analyticsInitConfig . credentials ) ;
227+ analyticsInitConfig . credentials =
228+ analyticsInitConfig . credentials && atob ( analyticsInitConfig . credentials ) ;
230229 }
231230 } catch ( e ) {
232231 console . error ( 'Endpoint not set correctly for analytics' ) ;
@@ -288,7 +287,7 @@ const ReactiveBase =defineComponent( {
288287 </ Provider >
289288 ) ;
290289 } ,
291- } ) ;
290+ } ;
292291ReactiveBase . install = function ( Vue ) {
293292 Vue . component ( ReactiveBase . name , ReactiveBase ) ;
294293} ;
0 commit comments