mirror of
https://github.com/vale981/doccam-pi
synced 2025-03-05 17:31:39 -05:00
137 lines
3.1 KiB
HTML
137 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>JSDoc: Source: src/actions.js</title>
|
|
|
|
<script src="scripts/prettify/prettify.js"> </script>
|
|
<script src="scripts/prettify/lang-css.js"> </script>
|
|
<!--[if lt IE 9]>
|
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
<![endif]-->
|
|
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="main">
|
|
|
|
<h1 class="page-title">Source: src/actions.js</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<section>
|
|
<article>
|
|
<pre class="prettyprint source linenums"><code>/** Outsourced definition of the actions and simple action creators for simple actions.
|
|
* @module Actions
|
|
* @todo allowed values
|
|
*/
|
|
|
|
const Promise = require('promise');
|
|
const writeConfig = require('./utility/config.js').write;
|
|
|
|
/**
|
|
* Actions
|
|
* The action definitions.
|
|
*/
|
|
let actions = {
|
|
UPDATE_CONFIG: 'UPDATE_CONFIG',
|
|
REQUEST_START: 'REQUEST_START',
|
|
SET_STARTED: 'SET_STATED',
|
|
REQUEST_STOP: 'REQUEST_STOP',
|
|
SET_STOPPED: 'SET_STOPPED',
|
|
REQUEST_RESTART: 'REQUEST_RESTART',
|
|
SET_ERROR: 'SET_ERROR',
|
|
TRY_RECONECT: 'TRY_RECONNECT'
|
|
};
|
|
|
|
/**
|
|
* Trivial Action Creators
|
|
*/
|
|
let creators = {};
|
|
|
|
creators.updateConfig = function(update) {
|
|
return function(dispatch, getState) {
|
|
dispatch({
|
|
type: actions.UPDATE_CONFIG,
|
|
data: update
|
|
});
|
|
|
|
return writeConfig(getState());
|
|
};
|
|
};
|
|
|
|
creators.requestStart = function() {
|
|
return {
|
|
type: actions.REQUEST_START
|
|
};
|
|
};
|
|
|
|
creators.requestStop = function() {
|
|
return {
|
|
type: actions.REQUEST_STOP
|
|
};
|
|
};
|
|
|
|
creators.setStarted = function() {
|
|
return {
|
|
type: actions.SET_STARTED
|
|
};
|
|
};
|
|
|
|
creators.setStopped = function() {
|
|
return {
|
|
type: actions.SET_STOPPED
|
|
};
|
|
};
|
|
|
|
creators.requestRestart = function() {
|
|
return {
|
|
type: actions.REQUEST_RESTART
|
|
};
|
|
};
|
|
|
|
creators.setError = function(error) {
|
|
return {
|
|
type: actions.SET_ERROR,
|
|
data: error
|
|
};
|
|
};
|
|
|
|
creators.tryReconnect = function() {
|
|
return {
|
|
type: actions.TRY_RECONECT
|
|
};
|
|
};
|
|
|
|
module.exports = {
|
|
actions,
|
|
creators
|
|
};
|
|
</code></pre>
|
|
</article>
|
|
</section>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<nav>
|
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Actions.html">Actions</a></li><li><a href="module-Commander.html">Commander</a></li><li><a href="module-Main.html">Main</a></li><li><a href="module-Reducers.html">Reducers</a></li><li><a href="module-Streamer.html">Streamer</a></li><li><a href="module-Utilities_Config.html">Utilities/Config</a></li></ul><h3>Classes</h3><ul><li><a href="module-Commander-Commander.html">Commander</a></li><li><a href="module-Streamer-Streamer.html">Streamer</a></li></ul>
|
|
</nav>
|
|
|
|
<br class="clear">
|
|
|
|
<footer>
|
|
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Apr 24 2017 18:52:45 GMT+1200 (NZST)
|
|
</footer>
|
|
|
|
<script> prettyPrint(); </script>
|
|
<script src="scripts/linenumber.js"> </script>
|
|
</body>
|
|
</html>
|