Skip to content

Commit 1ce0f5a

Browse files
authored
Merge pull request #32 from togglebyte/dev
fixed invalid canvas docs re: restoring buffer
2 parents 95dab4c + 23b364d commit 1ce0f5a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/templates/elements/canvas.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ parent.
1212
Hot reloading will clear the canvas as the cells are not stored as state.
1313
Since components (but not prototype components) are restored upon hot reloading it
1414
is possible to save the buffer from the canvas to the component using
15-
`canvas.take_buffer()` using `unmount` on the component, and to restore it using
16-
`mount`.
17-
18-
restore, take buffer
15+
`canvas.take_buffer()` when the component is unmounted, and to restore it using `canvas.restore_buffer` when the component is mounted.
1916

2017
## Example
2118

@@ -84,6 +81,6 @@ Clear the canvas
8481

8582
Remove the buffer from the canvas
8683

87-
### `restore(buffer)`
84+
### `restore_buffer(&mut CanvasBuffer)`
8885

8986
Sets a buffer to the canvas

0 commit comments

Comments
 (0)