Skip to content

Commit fbafd77

Browse files
authored
fix: Fix creator api by adding destroy method
1 parent 2bdb1b1 commit fbafd77

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
registry-url: "https://registry.npmjs.org"
2424
- run: npm ci
2525
- run: npm run build
26-
- run: npm audit singatures --omit=dev # --omit-dev because of axios vulneraiblity used by wasm-pack, not in prod, vulnerability is active only when user input is provided
26+
- run: npm audit signatures --omit=dev # --omit-dev because of axios vulneraiblity used by wasm-pack, not in prod, vulnerability is active only when user input is provided
2727
- name: Release
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,13 @@ _Hello there!_
33
```bash
44
npm i @mateuszjs/magic-render
55
```
6+
7+
# Releasing versions
8+
9+
Each Pull Request has to be merged with squash, the following naming convention needs to be respected:
10+
11+
| Commit Message | Release Type |
12+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
13+
| `fix(pencil): stop graphite breaking when too much pressure applied` | patch/fix |
14+
| `feat(pencil): add 'graphiteWidth' option` | minor/feature |
15+
| `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | major/breaking release <br /> (Note that the `BREAKING CHANGE: ` token must be in the footer of the commit) |

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { State } from "../crate/glue_code"
1010
export interface CreatorAPI {
1111
addImage: (img: HTMLImageElement) => void
1212
updatePoints: (textureId: number, points: Point[]) => void
13+
destroy: VoidFunction
1314
}
1415

1516
export default async function initCreator(
@@ -62,6 +63,10 @@ export default async function initCreator(
6263
},
6364
updatePoints: (textureId, points) => {
6465
state.update_points(textureId, points)
66+
},
67+
destroy: () => {
68+
context.unconfigure()
69+
device.destroy()
6570
}
6671
}
6772
}

0 commit comments

Comments
 (0)