Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { AbilityScore } from 'charactersheet/models/character/ability_score';
- import {
- CoreManager,
- Notifications
- } from 'charactersheet/utilities';
- import ko from 'knockout';
- export class AbilityScoresViewModelDelegate {
- abilityScoreDidChange = async (oldScore, newScore) => {
- // Fire notifications to alert the rest of the app.
- // Delegate methods don't return things to their host unless it should
- // tell the host to stop/restart doing something.
- Notifications.abilityScores.changed.dispatch();
- if (newScore.shortName() === 'INT') {
- Notifications.abilityScores.intelligence.changed.dispatch();
- } else if (newScore.shortName() === 'DEX') {
- Notifications.abilityScores.dexterity.changed.dispatch();
- }
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement