Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
38 lines (34 sloc)
1.2 KB
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
import { AppState } from "@nteract/types"; | |
/** | |
* Returns the theme of the notebook. Returns "light" if no theme is defined. | |
* | |
* @param state The state of the nteract application | |
* | |
* @returns The theme of the nteract application | |
*/ | |
export const userTheme = (state: AppState): string => | |
state.config.get("theme", "light"); | |
/** | |
* Returns the theme of the notebook. Returns "light" if no theme is defined. | |
* This is an alias for the `userTheme` selector. | |
* | |
* @param state The state of the nteract application | |
* | |
* @returns The theme of the nteract application | |
*/ | |
export const currentTheme = userTheme; | |
/** | |
* Returns the auto-save interval to be used in the notebook. Returns an | |
* interval around the two minute range if one is not provided in the config. | |
*/ | |
export const autoSaveInterval = (state: AppState): number => { | |
const DEFAULT_AUTOSAVE_INTERVAL_MS = 120000; | |
return state.config.get("autoSaveInterval", DEFAULT_AUTOSAVE_INTERVAL_MS); | |
}; | |
/** | |
* Returns the delete delay to be used in the notebook. | |
*/ | |
export const deleteDelay = (state: AppState): number => { | |
const DEFAULT_DELETE_DELAY_MS = 10 * 1000; | |
return state.config.get("deleteDelay", DEFAULT_DELETE_DELAY_MS); | |
}; |