This package has been deprecated

Author message:

View the README.md for this library

@augu/immutable
TypeScript icon, indicating that this package has built-in type declarations

0.6.1ย โ€ขย Publicย โ€ขย Published

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

npm version Stars Workflow Status Build Status Build Size

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

August

August

LICENSE

@augu/immutable is released under the MIT License. Read here for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i @augu/immutable

Weekly Downloads

34

Version

0.6.1

License

MIT

Unpacked Size

47.8 kB

Total Files

17

Last publish

Collaborators

  • auguwu
  • ohlookitsaugust