blob: 3867ed259862328684c18f4b310840ac96b7cfc9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import { inject, injectable } from "tsyringe";
import StartFollowOperator from "./StartFollowOperator";
import Operator from "../Operator";
import OperatorFactoryChain from "../OperatorFactoryChain";
import FollowMasterClient from "../../client/FollowMasterClient";
import * as operations from "../../../shared/operations";
@injectable()
export default class FollowOperatorFactoryChain
implements OperatorFactoryChain
{
constructor(
@inject("FollowMasterClient")
private followMasterClient: FollowMasterClient
) {}
create(op: operations.Operation, _repeat: number): Operator | null {
switch (op.type) {
case operations.FOLLOW_START:
return new StartFollowOperator(
this.followMasterClient,
op.newTab,
op.background
);
}
return null;
}
}
|