-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
I'm trying to understand every line of this beautiful example: https://codesandbox.io/embed/r5qmj8m6lq
Could you please suggest from where the "index" argument on line 12 is taken?
const fn = (order, down, originalIndex, curIndex, y) => index =>
I've tried console.logging index and it returns this:
0
1
2
3
The index clearly depends on the number of the springs generated, but how exactly does the fn function get the index value?
Thanks a million!
Upd:
By console.logging I've found out that fn(order.current) on line 19 is calling the return function instead of the fn itself, and passes two arguments there. But could you please help to find out where might this behaviour be defined?
I'm just trying to avoid the confusion in the future)
Peace & love!
Metadata
Metadata
Assignees
Labels
No labels