Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Acepie committed Apr 29, 2024
1 parent bbbed16 commit a388b2d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ gleam add p5js_gleam
Then add a call to the `start_sketch` function in your main function.

```gleam
import p5js_gleam.{type P5, SketchConfig}
import p5js_gleam.{type P5}
import p5js_gleam/bindings as p5
import gleam/option
fn setup(p: P5) -> String {
p5.create_canvas(p, 800.0, 600.0)
Expand All @@ -48,13 +47,8 @@ fn draw(p: P5, state: String) {
}
pub fn main() {
p5.start_sketch(SketchConfig(
init: setup,
draw: draw,
on_tick: option.None,
on_key: option.None,
on_mouse: option.None,
))
p5js_gleam.create_sketch(init: setup, draw: draw)
|> p5.start_sketch
}
```

Expand Down

0 comments on commit a388b2d

Please sign in to comment.