Skip to content

Commit 25bd453

Browse files
authored
Merge pull request #5 from eyas-ranjous/dev
v1.0.1
2 parents c8df9d4 + 04a0986 commit 25bd453

File tree

4 files changed

+39
-42
lines changed

4 files changed

+39
-42
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
## [1.0.1] - 2021-MAY-12
9+
### Fixed
10+
- README
811

912
## [1.0.0] - 2021-MAY-12
1013
### Added

README.md

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ constructor accepts an initial list of items that will be loaded internally and
6464
</table>
6565

6666
```js
67-
const sequentialRound = new SequentialRoundRobin(['T1', 'T2', 'T3']);
67+
const sequentialTable = new SequentialRoundRobin(['T1', 'T2', 'T3']);
6868

69-
const randomRound = new RandomRoundRobin([1, 2, 3]);
69+
const randomTable = new RandomRoundRobin([5, 10, 15]);
7070
```
7171

7272
#### TS
@@ -81,9 +81,9 @@ const randomRound = new RandomRoundRobin([1, 2, 3]);
8181
</table>
8282

8383
```js
84-
const sequentialRound = new SequentialRoundRobin<string>(['T1', 'T2', 'T3']);
84+
const sequentialTable = new SequentialRoundRobin<string>(['T1', 'T2', 'T3']);
8585

86-
const randomRound = new RandomRoundRobin<number>([1, 2, 3]);
86+
const randomTable = new RandomRoundRobin<number>([5, 10, 15]);
8787
```
8888

8989
### add(item)
@@ -103,11 +103,11 @@ adds a new item to the table.
103103
</table>
104104

105105
```js
106-
const { key, value } = sequentialRound.add('T4');
106+
const { key, value } = sequentialTable.add('T4');
107107
console.log(key, value); // 3, T4
108108

109-
const { key, value } = randomRound.add(4);
110-
console.log(key, value); // 3, 4
109+
const { key, value } = randomTable.add(25);
110+
console.log(key, value); // 3, 25
111111
```
112112

113113
#### TS
@@ -124,11 +124,11 @@ console.log(key, value); // 3, 4
124124
</table>
125125

126126
```js
127-
const item: RoundRobinItem = sequentialRound.add('T4');
127+
const item: RoundRobinItem = sequentialTable.add('T4');
128128
console.log(item); // { key: 3, value: 'T4' }
129129

130-
const item: RoundRobinItem = randomRound.add('T4');
131-
console.log(item); // { key: 3, value: 'T4' }
130+
const item: RoundRobinItem = randomTable.add(25);
131+
console.log(item); // { key: 3, value: 25 }
132132
```
133133

134134
### count()
@@ -144,9 +144,9 @@ returns the number of items in the table.
144144
</table>
145145

146146
```js
147-
console.log(sequentialRound.count()); // 4
147+
console.log(sequentialTable.count()); // 4
148148

149-
console.log(randomRound.count()); // 4
149+
console.log(randomTable.count()); // 4
150150
```
151151

152152
### next()
@@ -163,21 +163,20 @@ returns the next item in the round.
163163

164164
```js
165165
// first round
166-
console.log(sequentialRound.next()); // { key: 0, value: 'T1' }
167-
console.log(sequentialRound.next()); // { key: 1, value: 'T2' }
168-
console.log(sequentialRound.next()); // { key: 2, value: 'T3' }
169-
console.log(sequentialRound.next()); // { key: 3, value: 'T4' }
166+
console.log(sequentialTable.next()); // { key: 0, value: 'T1' }
167+
console.log(sequentialTable.next()); // { key: 1, value: 'T2' }
168+
console.log(sequentialTable.next()); // { key: 2, value: 'T3' }
169+
console.log(sequentialTable.next()); // { key: 3, value: 'T4' }
170170
// second round ...
171-
console.log(sequentialRound.next()); // { key: 0, value: 'T1' }
172-
171+
console.log(sequentialTable.next()); // { key: 0, value: 'T1' }
173172

174173
// first round
175-
console.log(randomRound.next()); // { key: 3, value: 'T4' }
176-
console.log(randomRound.next()); // { key: 0, value: 'T1' }
177-
console.log(randomRound.next()); // { key: 2, value: 'T3' }
178-
console.log(randomRound.next()); // { key: 1, value: 'T2' }
174+
console.log(randomTable.next()); // { key: 2, value: 15 }
175+
console.log(randomTable.next()); // { key: 1, value: 10 }
176+
console.log(randomTable.next()); // { key: 0, value: 5 }
177+
console.log(randomTable.next()); // { key: 3, value: 25 }
179178
// second round ...
180-
console.log(randomRound.next()); // { key: 2, value: 'T3' }
179+
console.log(randomTable.next()); // { key: 1, value: 10 }
181180
```
182181

183182
### completedRounds()
@@ -193,9 +192,9 @@ returns the number of completed rounds.
193192
</table>
194193

195194
```js
196-
console.log(sequentialRound.completedRounds()); // 1
195+
console.log(sequentialTable.completedRounds()); // 1
197196

198-
console.log(randomRound.completedRounds()); // 1
197+
console.log(randomTable.completedRounds()); // 1
199198
```
200199

201200
### delete(key)
@@ -211,17 +210,17 @@ deletes an item from the table by its key.
211210
</table>
212211

213212
```js
214-
sequentialRound.delete(0);
215-
sequentialRound.delete(2);
216-
console.log(sequentialRound.next()); // { key: 1, value: 'T2' }
217-
console.log(sequentialRound.next()); // { key: 3, value: 'T4' }
218-
console.log(sequentialRound.next()); // { key: 1, value: 'T2' }
219-
220-
randomRound.delete(0);
221-
randomRound.delete(2);
222-
console.log(sequentialRound.next()); // { key: 3, value: 'T4' }
223-
console.log(sequentialRound.next()); // { key: 1, value: 'T2' }
224-
console.log(sequentialRound.next()); // { key: 3, value: 'T4' }
213+
sequentialTable.delete(0);
214+
sequentialTable.delete(2);
215+
console.log(sequentialTable.next()); // { key: 1, value: 'T2' }
216+
console.log(sequentialTable.next()); // { key: 3, value: 'T4' }
217+
console.log(sequentialTable.next()); // { key: 1, value: 'T2' }
218+
219+
randomTable.delete(0);
220+
randomTable.delete(2);
221+
console.log(randomTable.next()); // { key: 3, value: 25 }
222+
console.log(randomTable.next()); // { key: 1, value: 10 }
223+
console.log(randomTable.next()); // { key: 3, value: 25 }
225224
```
226225

227226
### reset()

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "round-robin-js",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "an implementation of round robin as a data structure",
55
"main": "index.js",
66
"scripts": {

test/test.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)