Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pshihn committed Mar 1, 2018
1 parent b33bffd commit b1cc057
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class Adder {
})();
```

## Custom workers

### Custom workers
The above examples only work when the class/function is not dependent on the containing scope, i.e. other libraries or global objects. But, you can create a custom worker.js file and move the code in there. In the worker, you can expose your object/function/class using <i>workly.expose</i> method.

In this example, the function depends on moment.js
Expand Down Expand Up @@ -89,11 +88,11 @@ workly.expose(friendlyTime);
})();
```

## Caveats
### Caveats
If you're not using a custom worker, the function/class being pushed to the worker cannot depend on the containing scope.
Since workers do not have access to DOM, DOM manipulation is not supported.

## Examples
### Examples
See the [examples folder](https://github.com/pshihn/workly/tree/master/examples)

### License
Expand Down

0 comments on commit b1cc057

Please sign in to comment.