@mongodb-js/compass-query-bar
Version:
Renders a component for executing MongoDB queries through a GUI.
37 lines (32 loc) • 965 B
JavaScript
const Reflux = require('reflux');
const StateMixin = require('reflux-state-mixin');
/**
* The default description.
*/
const DEFAULT_DESCRIPTION = 'Topology type not yet discovered.';
/**
* Deployment State store.
*/
const DeploymentStateStore = Reflux.createStore({
/**
* adds a state to the store, similar to React.Component's state
* @see https://github.com/yonatanmn/Super-Simple-Flux#reflux-state-mixin
*
* If you call `this.setState({...})` this will cause the store to trigger
* and push down its state as props to connected components.
*/
mixins: [StateMixin.store],
/**
* Initialize the Deployment State store state. The returned object must
* contain all keys that you might want to modify with this.setState().
*
* @return {Object} initial store state.
*/
getInitialState() {
return {
isWritable: true,
description: DEFAULT_DESCRIPTION
};
}
});
module.exports = DeploymentStateStore;