mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +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 alt from '../alt';
|
||||||
import Q from 'q';
|
import Q from 'q';
|
||||||
|
|
||||||
|
import ActionQueue from '../utils/action_queue_utils';
|
||||||
|
|
||||||
import PieceListFetcher from '../fetchers/piece_list_fetcher';
|
import PieceListFetcher from '../fetchers/piece_list_fetcher';
|
||||||
|
|
||||||
class PieceListActions {
|
class PieceListActions extends ActionQueue {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
this.generateActions(
|
this.generateActions(
|
||||||
'updatePieceList',
|
'updatePieceList',
|
||||||
'updatePieceListRequestActions',
|
'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