Skip to content

Commit

Permalink
add missing src/B.js from template
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Jun 20, 2024
1 parent e1f1ebd commit cc1f0b0
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions src/B.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import A from './A';
import {
getType
}
from 'model-attributes';
import {
LogLevelMixin
}
from 'loglevel-mixin';

import {
StateTransitionMixin,
defineActionMethods,
prepareActions
}
from 'statetransition-mixin';

const actions = prepareActions({
start: {
stopped: {
target: 'running',
during: 'starting',
rejected: 'failed',
timeout: 5000
}
},
restart: {
stopped: {
target: 'running',
during: 'starting',
rejected: 'failed',
timeout: 5000
},
running: {
target: 'running',
during: 'restarting',
timeout: 5000
}
},
stop: {
running: {
target: 'stopped',
during: 'stopping',
rejected: 'failed',
timeout: 5000
},
starting: {
target: 'stopped',
during: 'stopping',
rejected: 'failed',
timeout: 5000
},
failed: {
target: 'stopped',
during: 'stopping',
rejected: 'failed',
timeout: 1000
}
}
});

export default class B extends StateTransitionMixin(LogLevelMixin(A), actions, 'stopped') {
constructor() {
super();
console.log('constructor B');
this.type = getType('string');
console.log(`type: ${this.type.name}`);
console.log(`logLevel: ${this.logLevel}`);
console.log(`state: ${this.state}`);
}
}

defineActionMethods(A.prototype, actions);

0 comments on commit cc1f0b0

Please sign in to comment.