Skip to content

Commit

Permalink
feat(refresher): snippets for refresher
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjulian committed Mar 19, 2019
1 parent 6ed637c commit 8322506
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ Type part of a snippet, press enter, and the snippet unfolds.
| `i-radio` | `<ion-radio>` |
| `i-radio-checked` | `<ion-radio>` checked |
| `i-radio-group` | `<ion-radio-group>` |
| `i-refresher` | `<ion-refresher>` |
| `i-refresher-content` | `<ion-refresher>` w/ `<ion-refresher-content>` options |
| `i-refresher-events` | `<ion-refresher>` w/ all events |
| `i-row` | `<ion-row>` w/ `<ion-col>` |
| `i-searchbar` | `<ion-searchbar>` |
| `i-segment` | `<ion-segment>` |
Expand Down Expand Up @@ -229,6 +232,7 @@ Type part of a snippet, press enter, and the snippet unfolds.
| `i-on-did-dismiss-data` | Ionic `onDidDismiss` for dialogs returning data |
| `i-on-will-dismiss` | Ionic `onWillDismiss` for dialogs |
| `i-on-will-dismiss-data` | Ionic `onWillDismiss` for dialogs returning data |
| `i-refresher-do-refresh` | `<ion-refesher ionRefresh>` output handler method |
| `i-toast` | Ionic toast notification method |
| `i-toast-ctrl` | Ionic ToastController |
| `i-view-will-enter` | `ionViewWillEnter` (1st) - Fired when entering a page (also if it’s come back from stack), subscribe to `Observables` here or in `ionViewDidEnter` |
Expand Down
32 changes: 32 additions & 0 deletions snippets/html.json
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,38 @@
],
"description": "<ion-radio-group>"
},
"ion-refresher": {
"prefix": "i-refresher",
"body": [
"<ion-refresher slot=\"fixed\" (ionRefresh)=\"${1:doRefresh}(\\$event)\">",
"\t<ion-refresher-content></ion-refresher-content>",
"</ion-refresher>"
],
"description": "<ion-refresher>"
},
"ion-refresher-content": {
"prefix": "i-refresher-content",
"body": [
"<ion-refresher slot=\"fixed\" (ionRefresh)=\"${1:doRefresh}(\\$event)\">",
"\t<ion-refresher-content",
"\t\tpullingIcon=\"${2:arrow-dropdown}\"",
"\t\tpullingText=\"${3:Pull to refresh}\"",
"\t\trefreshingSpinner=\"${4|bubbles,circles,crescent,dots,lines,lines-small|}\"",
"\t\trefreshingText=\"${5:Refreshing...}\">",
"\t</ion-refresher-content>",
"</ion-refresher>"
],
"description": "<ion-refresher> w/ <ion-refresher-content> options"
},
"ion-refresher-events": {
"prefix": "i-refresher-events",
"body": [
"<ion-refresher slot=\"fixed\" (ionRefresh)=\"${1:doRefresh}(\\$event)\" (ionPull)=\"${2:onPull}(\\$event)\" (ionStart)=\"${3:onStart}(\\$event)\">",
"\t<ion-refresher-content></ion-refresher-content>",
"</ion-refresher>"
],
"description": "<ion-refresher> w/ all events"
},
"ion-row": {
"prefix": "i-row",
"body": [
Expand Down
14 changes: 14 additions & 0 deletions snippets/typescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,20 @@
],
"description": "`onWillDismiss`"
},
"ion-refresher-do-refresh": {
"prefix": "i-refresher-do-refresh",
"body": [
"${1:doRefresh}(${2:event}) {",
"\tconsole.log('Begin async operation');",
"\t",
"\tsetTimeout(() => {",
"\t\tconsole.log('Async operation has ended');",
"\t\t${2:event}.target.complete();",
"\t}, 2000);",
"}"
],
"description": "<ion-refesher ionRefresh> output handler method"
},
"ion-toast": {
"prefix": "i-toast",
"body": [
Expand Down

0 comments on commit 8322506

Please sign in to comment.