improve typings
This commit is contained in:
parent
fa17a998f1
commit
bb4820e980
@ -66,14 +66,14 @@ export class Objectmap<T> {
|
|||||||
/**
|
/**
|
||||||
* gets an object in the Observablemap and removes it, so it can't be retrieved again
|
* gets an object in the Observablemap and removes it, so it can't be retrieved again
|
||||||
*/
|
*/
|
||||||
getOneAndRemove() {
|
getOneAndRemove(): T {
|
||||||
return this.objectArray.shift()
|
return this.objectArray.shift()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* finds a specific element and then removes it
|
* finds a specific element and then removes it
|
||||||
*/
|
*/
|
||||||
findOneAndRemove(findFunction) {
|
findOneAndRemove(findFunction): T {
|
||||||
let foundElement = this.find(findFunction)
|
let foundElement = this.find(findFunction)
|
||||||
if (foundElement) {
|
if (foundElement) {
|
||||||
this.remove(foundElement)
|
this.remove(foundElement)
|
||||||
|
Loading…
Reference in New Issue
Block a user