Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async refreshToggle() {
const analyticsEnabled = await Analytics.isEnabled();
this.setState({ analyticsEnabled });
}
async componentDidMount() {
const component = this;
const analyticsEnabled = await Analytics.isEnabled();
component.setState({ analyticsEnabled });
}
toggle: async () => {
await Analytics.setEnabled(!this.state.analyticsEnabled);
const analyticsEnabled = await Analytics.isEnabled();
this.setState({ analyticsEnabled });
}
},
async toggleEnabled() {
await Analytics.setEnabled(!this.state.analyticsEnabled);
const analyticsEnabled = await Analytics.isEnabled();
this.setState({ analyticsEnabled });
}
async refreshToggle() {
const analyticsEnabled = await Analytics.isEnabled();
this.setState({ analyticsEnabled });
}
async toggleEnabled() {
await Analytics.setEnabled(!this.state.analyticsEnabled);
const analyticsEnabled = await Analytics.isEnabled();
this.setState({ analyticsEnabled });
}
async componentDidMount() {
const component = this;
const analyticsEnabled = await Analytics.isEnabled();
component.setState({ analyticsEnabled });
}
async toggleEnabled() {
await Analytics.setEnabled(!this.state.analyticsEnabled);
const analyticsEnabled = await Analytics.isEnabled();
this.setState({ analyticsEnabled });
}
async componentDidMount() {
const component = this;
const analyticsEnabled = await Analytics.isEnabled();
component.setState({ analyticsEnabled });
}
async toggleEnabled() {
await Analytics.setEnabled(!this.state.analyticsEnabled);
const analyticsEnabled = await Analytics.isEnabled();
this.setState({ analyticsEnabled });
}