Transducer flatten and uniq
问题 I'm wondering if there is a way by using a transducer for flattening a list and filter on unique values? By chaining, it is very easy: import {uniq, flattenDeep} from 'lodash';| const arr = [1, 2, [2, 3], [1, [4, 5]]]; uniq(flattendDeep(arr)); // -> [1, 2, 3, 4, 5] <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.core.min.js"></script> But here we loop twice over the list (+ n by depth layer). Not ideal. What I'm trying to achieve is to use a transducer for this