-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
71 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/compass-indexes/src/modules/is-search-indexes-supported.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { AnyAction } from 'redux'; | ||
|
||
export const IS_SEARCH_INDEXES_SUPPORTED_CHANGED = | ||
'indexes/is-search-indexes-supported/is-search-indexes-supported-changed'; | ||
|
||
/** | ||
* The initial state of the is readonly view attribute. | ||
*/ | ||
export const INITIAL_STATE = false; | ||
|
||
/** | ||
* Reducer function for is readonly view state. | ||
* | ||
* @param {Boolean} state - The state. | ||
* | ||
* @returns {Boolean} The state. | ||
*/ | ||
export default function reducer( | ||
state = INITIAL_STATE, | ||
action: AnyAction | ||
): boolean { | ||
if (action.type === IS_SEARCH_INDEXES_SUPPORTED_CHANGED) { | ||
return action.isSearchIndexesSupported; | ||
} | ||
return state; | ||
} | ||
|
||
/** | ||
* Action creator for readonly view changed events. | ||
* | ||
* @param {Boolean} isReadonlyView - Is the view readonly. | ||
* | ||
* @returns {import('redux').AnyAction} The readonly view changed action. | ||
*/ | ||
export const isSearchIndexesSupportedChanged = ( | ||
isSearchIndexesSupported: boolean | ||
) => ({ | ||
type: IS_SEARCH_INDEXES_SUPPORTED_CHANGED, | ||
isSearchIndexesSupported, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters