Axinom Mosaic Libraries
    Preparing search index...
    • Function to be used to construct an object. If value is false - property will not be added to object. If value is true - it will be added. Useful when you want to add a property with one value based on another value and their types are different. Example:

         const customConfig = {
      title: element.title,
      ...conditional(config.isDev , () => ({ devProperty: 'devValue' })),
      }

      Parameters

      • condition: boolean

        boolean value to determine if partial object shall be returned

      • map: () => Dict<unknown>

        mapping function that will return a partial object for the property

      Returns false | Dict<unknown>