Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fuse = new Fuse(items[platform], {
shouldSort: true,
threshold: 0.6,
location: 0,
distance: 100,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: [
'name',
],
});
items[platform] = fuse.search(searchTerm);
});
this.setState({ items });
forceCheck(); // Recheck lazyload
}
function WorksContainer() {
const [textFilter, setTextFilter] = useState('');
const { locale } = useIntl();
const language = languageNameToId(locale);
const { loading, error, data } = useQuery(FETCH_WORKS, {
variables: { language }
});
if (loading) return ;
if (error) return <p id="error_releases">Error :(</p>;
forceCheck();
return (
<div>
</div>
);
}
componentDidUpdate (prevProps) {
if (this.areAnimationsDisabled() && prevProps.skins !== this.props.skins) {
forceCheck();
}
}
componentDidMount() {
this.props.IndexActivityModule()
forceCheck()
this.myScroll = new BScroll(this.wrap.current, {
bounce: false,
scrollbar: true,
probeType: 3,
click: true, pullUpLoad: {
threshold: 50
}
})
}
refresh = () => {
private shouldUpdate (values: any): void {
forceCheck()
if (this.doUpdate) return
const shouldUpdate =
values.scrollHeight - values.scrollTop - values.clientHeight <
UPDATE_OFFSET
if (shouldUpdate) {
this.doUpdate = true
if (this.state.fetchCourses) this.state.fetchCourses(true, STEP_LIMIT)
}
}
componentDidUpdate() {
forceCheck();
}