oetiker / callbackery

Callbackery a Frontend Builder Toolkit
GNU General Public License v3.0
11 stars 10 forks source link

Skip if button has no action #144

Closed sirtoobii closed 3 years ago

sirtoobii commented 3 years ago

Such a scenario could be possible if based on certain conditions, an action (and their respective button) is available or not.

# actionCfg 
[
    ...
   $condition ? {
          action => 'submit',
          ...
   }: {},
]
oetiker commented 3 years ago

why would this button be created in the first place then ?

oetiker commented 3 years ago

I often use this pattern:


$condition ?
  { 
     button-definition
   }: ()