import { curry } from '@typed/lambda' ; import { withMutations } from './withMutations' ; export const appendTo = curry ( __appendTo ) ; function __appendTo < A , B > ( key , value , map ) { return withMutations ( ( x ) => { const currentValues = x . get ( key ) || [ ] ; x . set ( key , [ ... currentValues , value ] ) ; } , map ) ; }