MCPcopy Create free account
hub / github.com/facebook/Rapid / toggleRule

Method toggleRule

modules/core/ValidationSystem.js:475–485  ·  view source on GitHub ↗

* toggleRule * Toggles a single validation rule, * then reruns the validation so that the user sees something happen in the UI * @param {string} ruleID - The rule to toggle (e.g. 'crossing_ways')

(ruleID)

Source from the content-addressed store, hash-verified

473 * @param {string} ruleID - The rule to toggle (e.g. 'crossing_ways')
474 */
475 toggleRule(ruleID) {
476 if (this._disabledRuleIDs.has(ruleID)) {
477 this._disabledRuleIDs.delete(ruleID);
478 } else {
479 this._disabledRuleIDs.add(ruleID);
480 }
481
482 const storage = this.context.systems.storage;
483 storage.setItem('validate-disabledRules', [...this._disabledRuleIDs].join(','));
484 this.validateAsync();
485 }
486
487
488 /**

Callers 1

toggleRuleFunction · 0.80

Calls 2

validateAsyncMethod · 0.95
setItemMethod · 0.45

Tested by

no test coverage detected