react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

Array conditional for cond undocumented

Open louispvb opened this issue 8 years ago • 2 comments

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.

louispvb avatar Jun 26 '18 23:06 louispvb

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

louispvb avatar Jun 29 '18 17:06 louispvb

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

osdnk avatar Jul 02 '18 11:07 osdnk