Files
mattermost/webapp/components/suggestion/provider.jsx
Harrison Healey fb6f2a123c PLT-5860 Updated copyright date (#6058)
* PLT-5860 Updated copyright date in about modal

* PLT-5860 Updated copyright notice in JSX files

* PLT-5860 Updated copyright notice in go files

* Fixed misc copyright dates

* Fixed component snapshots
2017-04-12 08:27:57 -04:00

29 lines
723 B
JavaScript

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
export default class Provider {
constructor() {
this.latestPrefix = '';
this.latestComplete = true;
}
handlePretextChanged(suggestionId, pretext) { // eslint-disable-line no-unused-vars
// NO-OP for inherited classes to override
}
startNewRequest(prefix) {
this.latestPrefix = prefix;
this.latestComplete = false;
}
shouldCancelDispatch(prefix) {
if (prefix === this.latestPrefix) {
this.latestComplete = true;
} else if (this.latestComplete) {
return true;
}
return false;
}
}