Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add functions for changing order #20

Open
4 tasks
woylie opened this issue Feb 4, 2022 · 2 comments
Open
4 tasks

add functions for changing order #20

woylie opened this issue Feb 4, 2022 · 2 comments

Comments

@woylie
Copy link
Owner

woylie commented Feb 4, 2022

  • swap([:pets, 3], 5)
  • move_up([:pets, 3])
  • move_down([:pets, 3])
  • move_to([:pets, 3], 5])
@OnigiriJack
Copy link

how do we swap one pet's toys with another pet's toys at specific positions

[%Pet{id: 1, toys: [a, b]}, %Pet{id: 2, toys: [c, d]}]

@woylie
Copy link
Owner Author

woylie commented Feb 4, 2022

Probably swap([:owners, 2, :pets, 3], [:owners, 4, :pets, 1]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants