1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-29 00:58:03 +02:00

first cut: test queue inheritance

This commit is contained in:
Tim Daubenschütz 2015-08-06 18:03:13 +02:00
parent 158f91f3f2
commit 06f86b2a0e
2 changed files with 23 additions and 1 deletions

View File

@ -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',

View 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;