forked from shoutem/react-native-calendar-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
27 lines (24 loc) · 762 Bytes
/
index.js
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
/**
* Exposes the native CalendarManager module as a JS module.
* It has a function 'addEvent' which takes the following parameter:
*
* Object details: the details of the event to be added in the
* following format:
* {
* name: string
* location: string
* startTime: Number - number of miliseconds since epoch
* endTime: Number - number of miliseconds since epoch
* }
*
*/
import { NativeModules } from 'react-native';
export const PERMISSION_ERROR = 'permission';
const CalendarManager = NativeModules.CalendarManager;
export default {
...CalendarManager,
addEvent: (event, callback) => {
const dummyCallback = () => {};
CalendarManager.addEvent(event, callback || dummyCallback);
}
}