-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
53 lines (48 loc) · 1.59 KB
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
module todo {
export class App extends plat.App {
/**
* Class for every app. This class contains hooks for Application Lifecycle Events
* as well as error handling and navigation events.
*/
constructor() {
super();
}
/**
* Event fired when the app is ready
* @param ev The ILifecycleEvent object
*/
ready(ev: plat.events.ILifecycleEvent) {
// can be used to configure various
// settings prior to loading the
// rest of the application
}
/**
* Event fired when an internal error occurs.
* @param ev The IErrorEvent object.
*/
error(ev: plat.events.IErrorEvent<Error>) {
// log or handle errors at a global level
}
/**
* Event fired when the app is suspended.
* @param ev The ILifecycleEvent object.
*/
suspend(ev: plat.events.ILifecycleEvent) {
// if running on a device,
// this is where you want to save important
// data and finish ongoing processes.
}
/**
* Event fired when the app resumes from the suspended state.
* @param ev The ILifecycleEvent object.
*/
resume(ev: plat.events.ILifecycleEvent) {
// if running on a device,
// this is where you want to re-initialize
// the app state.
// this is called only when the app was
// previously suspended.
}
}
plat.register.app('todo', App);
}