Skip to content

Commit

Permalink
graph in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienMattiussi committed Mar 12, 2020
1 parent c7ba51e commit 50d8ac1
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,23 @@ const useReferenceArrayInputController = ({
const newIdsToFetch = difference(input.value, inputValue.current);
// Only get from store ids selected and already fetched
const newIdsToGetFromStore = difference(input.value, newIdsToFetch);

/*
input.value (current)
+------------------------+
| ********************** |
| ********************** | inputValue.current (old)
| ********** +-----------------------+
| ********** | ooooooooo | |
| ********** | ooooooooo | |
| ********** | ooooooooo | |
| ********** | ooooooooo | |
+---|--------|------|----+ |
| | | |
| | | |
| +------|----------------+
| |
newIdsToFetch newIdsToGetFromStore
*/
// Change states each time input values changes to avoid keeping previous values no more selected
if (!isEqual(idsToFetch, newIdsToFetch)) {
setIdsToFetch(newIdsToFetch);
Expand Down

0 comments on commit 50d8ac1

Please sign in to comment.