Skip to content

Commit

Permalink
Inserting dispatch in events
Browse files Browse the repository at this point in the history
  • Loading branch information
andrelmlins committed Nov 19, 2019
1 parent 323ee2e commit 684cf52
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ yarn install && yarn start

Raw component props (before transform):

| Prop | Type | Description |
| -------- | ---- | -------------- |
| onChange | func | Call in change |
| onError | func | Call in error |
| Prop | Type | Description |
| ------ | ---- | -------------- |
| change | func | Call in change |
| error | func | Call in error |

## Slot Properties

Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"sirv-cli": "^0.4.4",
"svelte-fullscreen": "^0.2.1"
"svelte-fullscreen": "^0.2.2"
},
"scripts": {
"build": "rollup -c",
Expand Down
8 changes: 4 additions & 4 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1458,10 +1458,10 @@ supports-color@^6.1.0:
dependencies:
has-flag "^3.0.0"

svelte-fullscreen@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/svelte-fullscreen/-/svelte-fullscreen-0.2.1.tgz#6cff6558f6d2cdc6d4086eb91abc1470d6b44721"
integrity sha512-jYBrDKW5mIjEtnlB7/Rk/eUCBs8mM77WH9v2xZFGqZ2nJHAz0KNyp2f7O/krxb6ioMb1URzgxce8qDMB+WFNJg==
svelte-fullscreen@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/svelte-fullscreen/-/svelte-fullscreen-0.2.2.tgz#91b3b569742ee615329fd3ba54b831b37c46bef3"
integrity sha512-FvjaOllwkDpSERrrda0iy8avAJC7Mli3dHrxKeUvirm7hIvDgesqqJJMg9MijCle8x+PbCP/FC5FWEzdgYgZBg==
dependencies:
screenfull "^5.0.0"

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelte-fullscreen",
"version": "0.2.2",
"version": "0.3.0",
"description": "Component that performs fullscreen in DOM Elements",
"repository": "https://github.com/andrelmlins/svelte-fullscreen",
"author": "André Lins <andrelucas01@hotmail.com> (https://andrelmlins.github.io/)",
Expand Down
5 changes: 3 additions & 2 deletions src/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import screenfull from "screenfull";
let component;
const dispatch = createEventDispatcher();
onMount(() => {
screenfull.on("change", () => dispatch("onChange"));
screenfull.on("error", () => dispatch("onError"));
screenfull.on("change", () => dispatch("change"));
screenfull.on("error", () => dispatch("error"));
});
const onToggle = () => {
Expand Down

0 comments on commit 684cf52

Please sign in to comment.