Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions WF_I_06_Angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ In the above example `item.type` (template expression) is not allowed to have si

The combination of an event binding and a property binding leads to a two-way binding:

```html
<form>
<input [(name)]="">{{ displayTypeOfComponent }}</input>
</form>
```

### Template Reference Variables

Expand Down
12 changes: 6 additions & 6 deletions WF_I_07_Promises_and_Workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const test = (input) => {
diffTime = performance.now() - startTime;
console.log (`Start Execution: ${diffTime} ms`);

test ( 0 );
test(0);

diffTime = performance.now() - startTime;
console.log (`End script: ${diffTime} ms`);
Expand Down Expand Up @@ -221,7 +221,7 @@ const test = (input) => {
diffTime = performance.now() - startTime;
console.log (`Start Execution: ${diffTime} ms`);

test ( 0 ).then(input =>{
test(0).then(input =>{
diffTime = performance.now() - startTime;
console.log (`Returning input ${input}: ${diffTime} ms`);
});
Expand Down Expand Up @@ -261,17 +261,17 @@ As promised, I would like to add a few words on Web workers. With Moore's law dy
Let us consider the following case:

```js
for (let i = 0; i++; i< 100000>){
for (let i = 0; i< 100000; i++){
// do stuff
}
```

The goal of parallelisation would be to divide the above workload into smaller chunks that run on parallel processors. Remember that approaching this with the `setTimeout (..., 0)` trick would still have the code run with the same thread, albeit allowing the browser to perform some rendering in between the chunks:

```js
for (let i = 0; i++; i< 100>){
for (let i = 0; i< 100; i++){
setTimeout (() => {
for (let i = 0; i++; i< 1000>){
for (let j = 0; j< 1000; j++){
// do stuff
}
}, 0);
Expand Down Expand Up @@ -325,7 +325,7 @@ All we are left to do is to create multiple web workers to achieve parallelism.
isolatedTask = (index, input) => {
let resultChunk = [];

for (let i = 0; i++; i< 1000>){
for (let i = 0; i< 1000; i++){
resultChunk [i] = doHeavyStuff();
}

Expand Down