The task is: I have the input which implement autocomplete functionality. And i have function getItems which handle input changes and return a Promise which return an array of arbitrary objects that satisfy the filter criterion. function getItems can also return an object with method abort() which should be called on previous Promise when the previous Promise has not yet been resolved. For example:
- we enter g... (the getItems ('g') function is called ...)
- we press ge ... (if the previous Promise getItems ('g') has not yet been resolved - we call on the previous "promise" abort). I have no idea how to implement this. Help me please!