react-native-reanimated
react-native-reanimated copied to clipboard
Array conditional for cond undocumented
I see the following in the example for imageViewer:
cond([delta, gestureActive],
...
)
I'm not sure what the behavior for an array conditional for cond is.
It seems that it behaves as a block of code to be executed, which was a confusing style of programming because delta does not sound like a function invocation. The last node in the block is the condition to evaluate
Maybe it's not very obvious an this example calls to be fixed. However it's fully correct:
[...] is a synthatic sugar for block which does evaluate each nodes and return the last one as a result, which is an argument for cond