Skip to content

Commit 5ac74b8

Browse files
committed
docs: fix code typos in README
1 parent 27ed4c7 commit 5ac74b8

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

packages/gesturehandler/blueprint.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,26 @@
66
{{ template:toc }}
77

88
## Installation
9+
910
Run the following command from the root of your project:
1011

1112
`ns plugin add {{ pkg.name }}`
1213

1314
## API
1415

1516
We need to do some wiring when your app starts, so open `app.ts` and add this before creating any View/App/Frame:
17+
1618
##### TypeScript
19+
1720
```ts
18-
import { install } from "@nativescript-community/gesturehandler";
21+
import { install } from '@nativescript-community/gesturehandler';
1922
install();
2023
```
2124

2225
You create a gesture handler using something like this:
23-
```typescript
24-
import { GestureHandlerTouchEvent, GestureHandlerStateEvent, GestureStateEventData, GestureTouchEventData, HandlerType } from '@nativescript-community/gesturehandler';
2526

27+
```typescript
28+
import { GestureHandlerTouchEvent, GestureHandlerStateEvent, GestureStateEventData, GestureTouchEventData, HandlerType, Manager } from '@nativescript-community/gesturehandler';
2629

2730
function onGestureTouch(args: GestureTouchEventData) {
2831
const { state, extraData, view } = args.data;
@@ -34,17 +37,17 @@ function onGestureState(args: GestureStateEventData) {
3437
console.log('onGestureState', state, prevState, view, extraData);
3538
}
3639
const manager = Manager.getInstance();
37-
const gestureHandler = = manager.createGestureHandler(HandlerType.PAN, 10, {
40+
const gestureHandler = manager.createGestureHandler(HandlerType.PAN, 10, {
3841
shouldCancelWhenOutside: false
3942
});
4043
gestureHandler.on(GestureHandlerTouchEvent, onGestureTouch, this);
4144
gestureHandler.on(GestureHandlerStateEvent, onGestureState, this);
4245
gestureHandler.attachToView(view);
4346
```
4447

45-
Right now you must not forget to store the ```gestureHandler``` somewhere or the gesture won't work on iOS (native object being released). This will be fixed in future versions.
48+
Right now you must not forget to store the `gestureHandler` somewhere or the gesture won't work on iOS (native object being released). This will be fixed in future versions.
4649

47-
Now about the API. All the gestures for the react counterpart exist with the same options and the same event ```extraData```.
50+
Now about the API. All the gestures for the react counterpart exist with the same options and the same event `extraData`.
4851

4952
## GestureRootView
5053

@@ -54,21 +57,19 @@ In case you don't (drawer root view, modals, ...) then you can wrap your views i
5457

5558
## Overriding Nativescript gestures
5659

57-
This plugin can also override N gestures completely. This would give much more control over gestures and especially would allow to correctly handle simultaneous gestures likes `tap` and `longpress`
60+
This plugin can also override N gestures completely. This would give much more control over gestures and especially would allow to correctly handle simultaneous gestures likes `tap` and `longpress`.
5861

5962
To do that
6063

6164
## Credits
6265

6366
This is a port of [react-native-gesturehandler](https://kmagiera.github.io/react-native-gesture-handler/).
64-
The source is based on the source code by [Krzysztof Magiera](https://github.com/kmagiera). Dont hesitate to go and thank him for his work!
65-
66-
67+
The source is based on the source code by [Krzysztof Magiera](https://github.com/kmagiera). Don't hesitate to go and thank him for his work!
6768

6869
### Examples:
6970

7071
- [Basic](demo-snippets/vue/Basic.vue)
7172
- A basic example showing that overriding N gestures works, even in modals
7273

7374
{{ load:../../tools/readme/demos-and-development.md }}
74-
{{ load:../../tools/readme/questions.md }}
75+
{{ load:../../tools/readme/questions.md }}

0 commit comments

Comments
 (0)