There is no way to set this up so that getChoicesFromAnswers doesn't get called every time input changes (without implementing caching myself)
It would be nice to have it split into two functions, the first takes in answers and returns another function which takes in input, the result of which is the filtering
At the moment, the
source
parameter is a function that takes in two parameters:answers
andinput
That means that if I want to use
answers
to decide which choices are available andinput
to sort them, I have to do it like this:There is no way to set this up so that
getChoicesFromAnswers
doesn't get called every timeinput
changes (without implementing caching myself)It would be nice to have it split into two functions, the first takes in
answers
and returns another function which takes ininput
, the result of which is the filteringThat way
getChoicesFromAnswers
isn't called every timeinput
changes