UNPKG

react-native-dropdownalert

Version:

A simple alert to notify users about new chat messages, something went wrong or everything is ok.

29 lines (28 loc) 428 B
export default class Queue { constructor() { this.data = []; } get firstItem() { if (!this.isEmpty) { return this.data[0]; } return null; } get size() { return this.data.length; } get isEmpty() { return this.size === 0; } enqueue(item) { this.data.push(item); } dequeue() { if (!this.isEmpty) { this.data.shift(); } } clear() { this.data = []; } }