Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-google-calendar-api

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-google-calendar-api - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "react-google-calendar-api",
"version": "1.0.2",
"version": "1.0.3",
"description": "An api to manage your google calendar",

@@ -5,0 +5,0 @@ "main": "ApiCalendar.js",

@@ -49,2 +49,39 @@ ![alt](https://kitn.net/wp-content/uploads/2016/09/google-calendar-logo.jpg)

```
#### Example
```javascript
import React, {ReactNode, SyntheticEvent} from 'react';
import ApiCalendar from 'react-google-calendar-api';
export default class DoubleButton extends React.Component {
constructor(props) {
super(props);
this.handleItemClick = this.handleItemClick.bind(this);
}
public handleItemClick(event: SyntheticEvent<any>, name: string): void {
if (name === 'sign-in') {
ApiCalendar.handleAuthClick();
} else if (name === 'sign-out') {
ApiCalendar.handleSignoutClick();
}
}
render(): ReactNode {
return (
<button
onClick={(e) => this.handleItemClick(e, 'sign-in')}
>
sign-in
</button>
<button
onClick={(e) => this.handleItemClick(e, 'sign-out')}
>
sign-out
</button>
);
}
}
```

@@ -88,2 +125,20 @@ ### setCalendar:

public createEventFromNow({time, summary, description = ''}: any, calendarId: string = this.calendar): any
```
#### Example
```javascript
import ApiCalendar from 'react-google-calendar-api';
const eventFromNow: object = {
summary: "Poc Dev From Now",
time: 480,
};
ApiCalendar.createEventFromNow(eventFromNow)
.then((result: object) => {
console.log(result);
})
.catch((error: any) => {
console.log(error);
});
```

@@ -103,2 +158,14 @@

#### Example
```javascript
import ApiCalendar from 'react-google-calendar-api';
if (ApiCalendar.sign)
ApiCalendar.listUpcomingEvents(10)
.then(({result}: any) => {
console.log(result.items);
});
```
## Utils

@@ -125,1 +192,33 @@

```
#### Example
```javascript
import React, {ReactNode} from 'react';
import ApiCalendar from 'react-google-calendar-api';
export default class StatusSign extends React.Component<any, any> {
constructor(props) {
super(props);
this.state = {
sign: ApiCalendar.sign,
};
this.signUpdate = this.signUpdate.bind(this);
ApiCalendar.onLoad(() => {
ApiCalendar.listenSign(this.signUpdate);
});
}
public signUpdate(sign: boolean): any {
this.setState({
sign
})
}
render(): ReactNode {
return (
<div>{this.state.sign}</div>
);
}
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc