0.6.1 • Published 3 years ago
@augu/immutable v0.6.1
NOTICE
This library is deprecated in favour of @augu/collections, if you want a updated version of this library, please install it using npm i @augu/collections
! View the changes here.
~ August
@augu/immutable
Immutable library made in TypeScript
Examples
Collection
import { Collection } from '@augu/immutable';
const collection = new Collection<string>();
collection.add('a'); //> Collection [Map] { 0 => 'a' }
collection.map(s => s); //> ['a']
collection.delete('a'); //> true
Pair
import { Pair } from '@augu/immutable';
const pair = new Pair('a', 'b'); //> Pair<string, string>
pair.getRight(); //> 'a'
pair.getLeft(); //> 'b'
Queue
import { Queue } from '@augu/immutable';
const queue = new Queue(['a', 'b', 'c']); //> Queue<string>
queue.peekAt(0); //> 'a'
queue.peek(); //> 'c'
queue.enqueue('d'); //> Queue<string>
queue.tick(console.log); //> Logs 'a', 'b', 'c', 'd'
TimedQueue
import { TimedQueue } from '@augu/immutable';
const queue = new TimedQueue({
itemCount: 1, // emit only 1 item
every: 3000, // stop the timer at 3 seconds
time: 1000 // every time to "sleep" until enqueueing
});
queue.on('tick', console.log);
queue.add(['a', 'b', 'c']); // adds 'a', 'b', and 'c' to the queue
queue.start(); // starts the timer
Maintainers
LICENSE
@augu/immutable is released under the MIT License. Read here for more information.
0.6.1
3 years ago
0.6.0
3 years ago
0.5.0
4 years ago
0.4.3
4 years ago
0.4.2
4 years ago
0.4.1
4 years ago
0.4.0
4 years ago
0.3.2
4 years ago
0.3.1
4 years ago
0.3.0
4 years ago
0.2.6
4 years ago
0.2.5
4 years ago
0.2.3
4 years ago
0.2.2
4 years ago
0.2.1
4 years ago
0.2.0
4 years ago
0.1.7
4 years ago
0.1.6
4 years ago
0.1.5
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago
0.0.8
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago