Skip to content

Commit

Permalink
Added instructions for static html pages
Browse files Browse the repository at this point in the history
  • Loading branch information
duart38 committed Aug 2, 2020
1 parent 941a8ba commit b0e221a
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![nest badge](https://nest.land/badge.svg)](https://nest.land/package/Observe)


## Example
## Example (Deno)
```JavaScript
let obs = new Observe("initial value"); // new observable with type String

Expand All @@ -18,6 +18,29 @@ obs.setValue("another value"); // sets the value
```
Also check the examples folder for more examples

## Example (Basic html + js)
> Download Observe.js from the releases tab
**index.html**
```html
<html>
<head></head>
<body>
<h1>Observable value test</h1>
<script src="./Observe.js"></script>
<script src="./index.js"></script>
</body>
</html>
```

**index.js**
```JavaScript
var observable = new Observe("s")
observable.bind((d)=>{
console.log(d)
})
observable.setValue("new val")
```
## Methods

---
Expand Down

0 comments on commit b0e221a

Please sign in to comment.