mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
first cut: test queue inheritance
This commit is contained in:
parent
158f91f3f2
commit
06f86b2a0e
@ -3,10 +3,14 @@
|
||||
import alt from '../alt';
|
||||
import Q from 'q';
|
||||
|
||||
import ActionQueue from '../utils/action_queue_utils';
|
||||
|
||||
import PieceListFetcher from '../fetchers/piece_list_fetcher';
|
||||
|
||||
class PieceListActions {
|
||||
class PieceListActions extends ActionQueue {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.generateActions(
|
||||
'updatePieceList',
|
||||
'updatePieceListRequestActions',
|
||||
|
18
js/utils/action_queue_utils.js
Normal file
18
js/utils/action_queue_utils.js
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
class ActionQueue {
|
||||
constructor() {
|
||||
let actionClass = this.constructor.prototype;
|
||||
let actionClassPropertyNames = Object.getOwnPropertyNames(actionClass);
|
||||
|
||||
this.constructor = actionClass.constructor;
|
||||
|
||||
for(let i = 1; i < actionClassPropertyNames.length; i++) {
|
||||
let methodName = actionClassPropertyNames[i];
|
||||
actionClass[methodName] = () => console.log('hello');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default ActionQueue;
|
Loading…
Reference in New Issue
Block a user