(config: AsyncSystemConfig<any, any, any>)
| 4 | import {logWarn} from '../utils/logger'; |
| 5 | |
| 6 | export function checkAsyncSystemConfig(config: AsyncSystemConfig<any, any, any>): () => void { |
| 7 | if (config) { |
| 8 | if (config.clearDataOnError === true && config.clearDataOnQuery === true) { |
| 9 | return logWarn(`When "clearDataOnQuery" is set to true, |
| 10 | "clearDataOnError" stops working, as only one of them can work at a time\n |
| 11 | Consider only setting one at a time.`); |
| 12 | } |
| 13 | if (config.clearErrorOnData === true && config.clearErrorOnQuery === true) { |
| 14 | return logWarn(`When "clearErrorOnQuery" is set to true, |
| 15 | "clearErrorOnData" stops working, as only one of them can work at a time\n |
| 16 | Consider only setting one at a time.`); |
| 17 | } |
| 18 | } |
| 19 | return NOOP; |
| 20 | } |
| 21 | |
| 22 | export function checkSerializability<T>(o: T): void { |
| 23 | const [serializable, nonSerializableVal] = isSerializable(o); |
no test coverage detected