-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (27 loc) · 1.06 KB
/
index.js
File metadata and controls
30 lines (27 loc) · 1.06 KB
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
/*
* Copyright (c) 2024, Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import {withLegacyGetProps} from '@salesforce/pwa-kit-react-sdk/ssr/universal/components/with-legacy-get-props'
import {withReactQuery} from '@salesforce/pwa-kit-react-sdk/ssr/universal/components/with-react-query'
import AppConfig from '@salesforce/pwa-kit-react-sdk/ssr/universal/components/_app-config'
const isServerSide = typeof window === 'undefined'
// Recommended settings for PWA-Kit usages.
// NOTE: they will be applied on both server and client side.
const options = {
queryClientConfig: {
defaultOptions: {
queries: {
retry: false,
staleTime: 2 * 1000,
...(isServerSide ? {retryOnMount: false} : {})
},
mutations: {
retry: false
}
}
}
}
export default withReactQuery(withLegacyGetProps(AppConfig), options)