Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Commit 158fcb4

Browse files
committed
🚧 (BackHandlerDelegate) init BackHandlerDelegate
1 parent c1c9918 commit 158fcb4

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { BackHandler } from 'react-native';
2+
3+
export class BackHandlerDelegate {
4+
constructor() {
5+
BackHandler.addEventListener('hardwareBackPress', this.backHandler);
6+
}
7+
8+
private backHandler = () => {
9+
// tslint:disable-next-line
10+
console.log("Back action fired !");
11+
};
12+
}

src/Navigation/Navigation.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { FullScreenDelegate } from './FullScreenDelegate';
2+
import { BackHandlerDelegate } from './BackHandlerDelegate';
23

34
export class Navigation {
45
static get instance() {
@@ -11,4 +12,6 @@ export class Navigation {
1112
private static singleton: Navigation;
1213

1314
fullScreenDelegate = new FullScreenDelegate();
15+
16+
backHandlerDelegate = new BackHandlerDelegate();
1417
}

0 commit comments

Comments
 (0)