Skip to content

Commit 995ef30

Browse files
committed
Fixes headline structure in README.
1 parent a27de47 commit 995ef30

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Parallel Computing with Javascript
77
thread.js allows you to spawn webworkers without any hassle in node.js and in the webbrowser.
88
The API is really simple:
99

10-
var thread = new Thread(data, opts)
11-
---
10+
### API
11+
#### var thread = new Thread(data, opts)
1212
This initializes a new thread.js instance (note: not a webworker). ```data``` is any data you want to work with in your operations.
1313
In node.js data has to be ```JSON.serialize()```able, in a webbrowser, the object you want to transmit, has to be a transferable.
1414

@@ -29,19 +29,16 @@ The following options are available:
2929

3030
Note that every function call returns a promise!
3131

32-
.spawn(fn)
33-
---
32+
#### .spawn(fn)
3433
```.spawn``` spawns a single webworker with your given function as an argument.
3534
The function will receive one parameter with the data which is currently held by the thread.js instance.
3635
The value returned from spawn will be stored in the thread.js instance after execution in the worker.
3736

38-
.map(fn)
39-
---
37+
#### .map(fn)
4038
```.map``` spawns one worker per element in the ```data```-array up to the given ```maxWorkers``` option.
4139
The function given to map will receive a single element of the array and the returned value will be stored at that index of the array again.
4240

43-
.then(success, fail)
44-
---
41+
#### .then(success, fail)
4542
The functions given to ```.then``` are called after the last requested operation has finished.
4643
```success``` receives the resulting data object, while ```fail``` will receive an error object.
4744

0 commit comments

Comments
 (0)