Skip to content

Instantly share code, notes, and snippets.

@romasan
Created November 2, 2022 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romasan/baae61ff8fd5f12f9d7f57fbcee2dc1f to your computer and use it in GitHub Desktop.
Save romasan/baae61ff8fd5f12f9d7f57fbcee2dc1f to your computer and use it in GitHub Desktop.
import { append, curry, ifElse, includes, without } from 'ramda'
export const toggleItemInList = curry((value, list) => ifElse(includes(value), without([value]), append(value))(list))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment