Skip to content

Commit

Permalink
Make JobPool.lastJobId readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin Yang committed Dec 16, 2019
1 parent 7534ab2 commit fafa6e1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/JobPool.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import Job from './Job.class';

export default class JobPool {

public static lastJobId = '';

public static add (job: Job) {
JobPool.pool.set(job.id, job);
this.lastJobId = job.id;
this._lastJobId = job.id;
}
public static get (jobId: string) {
return JobPool.pool.get(jobId);
Expand All @@ -19,6 +17,12 @@ export default class JobPool {
return JobPool.pool.keys();
}

// tslint:disable-next-line variable-name
private static _lastJobId = '';
public static get lastJobId () {
return this._lastJobId;
}

private static pool = new Map<string, Job>();

}

0 comments on commit fafa6e1

Please sign in to comment.