Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(props) {
super(props);
this.navigate = props.navigation.navigate;
this.state = { MovieDetails: { Cast: '' } };
const self = this;
const { rank } = props.navigation.state.params;
this.vm = dotnetify.react.connect('AFIDetailsVM', this, {
vmArg: { Rank: rank },
exceptionHandler: ex => ScreenTracker.goToLoginScreen(self.navigate, ex)
});
}
connectLiveGauge = screen => {
const self = this;
if (screen == 'LiveGauge') {
this.vm = dotnetify.react.connect('LiveGaugeVM', this, {
exceptionHandler: ex => ScreenTracker.goToLoginScreen(self.navigate, ex)
});
}
else if (this.vm) {
this.vm.$destroy();
this.vm = null;
}
};
goToLoginScreen = (navigate, exception) => {
this.reset();
dotnetify.react.getViewModels().forEach(vm => vm.$destroy());
navigate('Login', exception);
};
}
token =>
(this.vm = dotnetify.react.connect('AFITop100ListVM', this, {
vmArg: { RecordsPerPage: 20 },
setState: this.updateMovies,
headers: { Authorization: 'Bearer ' + token },
exceptionHandler: ex => ScreenTracker.goToLoginScreen(self.navigate, ex)
}))
);