BVB Source Codes

reactide Show store.js Source code

Return Download reactide: download store.js Source code - Download reactide Source code - Type:.js
  1. /*:nodoc:*
  2.  * class ActionStore
  3.  *
  4.  * This action just stores the argument鈥檚 value. This is the default action.
  5.  *
  6.  * This class inherited from [[Action]]
  7.  *
  8.  **/
  9. 'use strict';
  10.  
  11. var util = require('util');
  12.  
  13. var Action = require('../action');
  14.  
  15. // Constants
  16. var c = require('../const');
  17.  
  18.  
  19. /*:nodoc:*
  20.  * new ActionStore(options)
  21.  * - options (object): options hash see [[Action.new]]
  22.  *
  23.  **/
  24. var ActionStore = module.exports = function ActionStore(options) {
  25.   options = options || {};
  26.   if (this.nargs <= 0) {
  27.     throw new Error('nargs for store actions must be > 0; if you ' +
  28.         'have nothing to store, actions such as store ' +
  29.         'true or store const may be more appropriate');
  30.  
  31.   }
  32.   if (typeof this.constant !== 'undefined' && this.nargs !== c.OPTIONAL) {
  33.     throw new Error('nargs must be OPTIONAL to supply const');
  34.   }
  35.   Action.call(this, options);
  36. };
  37. util.inherits(ActionStore, Action);
  38.  
  39. /*:nodoc:*
  40.  * ActionStore#call(parser, namespace, values, optionString) -> Void
  41.  * - parser (ArgumentParser): current parser
  42.  * - namespace (Namespace): namespace for output data
  43.  * - values (Array): parsed values
  44.  * - optionString (Array): input option string(not parsed)
  45.  *
  46.  * Call the action. Save result in namespace object
  47.  **/
  48. ActionStore.prototype.call = function (parser, namespace, values) {
  49.   namespace.set(this.dest, values);
  50. };
  51.  
downloadstore.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top