Skip to content

Commit

Permalink
Merge pull request #26949 from software-mansion-labs/ts-migration/net…
Browse files Browse the repository at this point in the history
…work-lib

[No QA] [TS migration] Migrate 'Network.js' lib to TypeScript
  • Loading branch information
AndrewGable authored Sep 12, 2023
2 parents 3fe7ab1 + d68c576 commit 54f3aa6
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/libs/actions/Network.js → src/libs/actions/Network.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
import Onyx from 'react-native-onyx';
import ONYXKEYS from '../../ONYXKEYS';

/**
* @param {Boolean} isOffline
*/
function setIsOffline(isOffline) {
function setIsOffline(isOffline: boolean) {
Onyx.merge(ONYXKEYS.NETWORK, {isOffline});
}

/**
*
* @param {Boolean} shouldForceOffline
*/
function setShouldForceOffline(shouldForceOffline) {
function setShouldForceOffline(shouldForceOffline: boolean) {
Onyx.merge(ONYXKEYS.NETWORK, {shouldForceOffline});
}

/**
* Test tool that will fail all network requests when enabled
* @param {Boolean} shouldFailAllRequests
*/
function setShouldFailAllRequests(shouldFailAllRequests) {
function setShouldFailAllRequests(shouldFailAllRequests: boolean) {
Onyx.merge(ONYXKEYS.NETWORK, {shouldFailAllRequests});
}

Expand Down

0 comments on commit 54f3aa6

Please sign in to comment.