The AppStore is a Reflux store that manages the central application state for terminal.sexy. It tracks the current color scheme, specific color values, and font settings.
State Structure
The state object returned by getState() contains:
scheme: The name of the current color scheme (e.g., 'terminal.sexy' or 'hybrid').colors: An object containing color definitions (foreground, background, and a list of colors).font: An object containing font configuration:name: The font family name (default: 'Droid Sans Mono').size: The font size (default: '14px').line: The line height (default: '21px').web: A boolean indicating if web fonts are enabled (default: true).
Interacting with the Store
You interact with the store by listening to specific actions. The store updates its internal state, synchronizes the URL hash via url.export, and triggers updates to listeners.
const AppStore = require('./lib/stores/app');
// Get the current state
const currentState = AppStore.getState();
// Listen for state changes
AppStore.on(state => {
console.log('New state:', state);
});