Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { AbilityScore } from 'charactersheet/models/character/ability_score';
  2. import {
  3.     CoreManager,
  4.     Notifications
  5. } from 'charactersheet/utilities';
  6. import ko from 'knockout';
  7.  
  8. export class AbilityScoresViewModelDelegate {
  9.  
  10.     abilityScoreDidChange = async (oldScore, newScore) => {
  11.         // Fire notifications to alert the rest of the app.
  12.         // Delegate methods don't return things to their host unless it should
  13.         // tell the host to stop/restart doing something.
  14.  
  15.         Notifications.abilityScores.changed.dispatch();
  16.         if (newScore.shortName() === 'INT') {
  17.             Notifications.abilityScores.intelligence.changed.dispatch();
  18.         } else if (newScore.shortName() === 'DEX') {
  19.             Notifications.abilityScores.dexterity.changed.dispatch();
  20.         }
  21.     };
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement