flowr

  • Docs
  • Examples
Docs Menu
  • Getting started
  • Conditionals
    • Maybe
    • Either
    • Flip
    • Reverse
    • Order
    • One
    • Some
    • Constant
    • Just
    • Nothing
    • Pure
  • Schedulers
    • Await
    • Stream
    • Delay
    • Debounce
    • Throttle

Maybe

import { Maybe } from 'flowr';

A Maybe is the basic implementation of a conditional render. If when prop is true, it will render all it's children, otherwise it will render nothing.

Hello, world!

Try out Flowr

// for predicate === true:

Hello, world!

Try out Flowr

// for predicate === false:

Props

NameTypeDefaultDescription
whenboolfalseWhen this is true, render all the child elements. If false, render nothing.

See also Either

Contribute on Github! Edit this section.