How to use the monet.Maybe.fromNull function in monet

To help you get started, we’ve selected a few monet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github neos / neos-ui / packages / neos-ui-editors / src / SecondaryEditors / ImageCropper / model.js View on Github external
            .bind(aspectRatio => Maybe.fromNull(
                //
                // Read out aspect ratio options and filter them
                //
                values(options).filter(o => o && (o.width / o.height).toFixed(2) === aspectRatio.toFixed(2))[0]
            ))
            .map(o => new ConfiguredAspectRatioStrategy(o.width, o.height, o.label))
github aappddeevv / dynamics-client-ui / packages / dynamics-client-ui-react / src / components / AddressManager / AddressEditor.tsx View on Github external
protected onSelectionChanged = (): void => {
        const item = firstOrElse(this.selection.getSelection(), null)
        const selected = Maybe.fromNull(item)
        this.setState({
            selected,
            buffer: selected.isSome ? Maybe.pure({ ...item }) : Maybe.None(),
            changed: [],
        })
        if (DEBUG) console.log(`${NAME}.onSelectionChanged`, this.selection.getSelection())
    }
github neos / neos-ui / packages / neos-ui / src / Containers / RightSideBar / Inspector / PropertyGroup / index.js View on Github external
key={viewId}
                                id={viewId}
                                label={view.label}
                                view={view.view}
                                options={view.viewOptions}
                                renderSecondaryInspector={renderSecondaryInspector}
                                node={node}
                                commit={commit}
                                />);
                    })}
                
            
        );
        const fallback = () =&gt; (<div>...</div>);

        return Maybe.fromNull(properties).map(propertyGroup).orSome(fallback());
    }
}
github neos / neos-ui / packages / neos-ui-editors / src / Editors / Image / Utils / index.js View on Github external
get resizeAdjustment() {
        const {image} = this;
        return Maybe.fromNull($get(RESIZE_IMAGE_ADJUSTMENT, image));
    }
github neos / neos-ui / packages / neos-ui / src / Containers / RightSideBar / Inspector / PropertyGroup / index.js View on Github external
label={$get('label', item)}
                                    view={$get('view', item)}
                                    options={$get('viewOptions', item) &amp;&amp; $get('viewOptions', item).toJS ? $get('viewOptions', item).toJS() : $get('viewOptions', item)}
                                    renderSecondaryInspector={renderSecondaryInspector}
                                    node={node}
                                    commit={commit}
                                    /&gt;);
                        }
                        return null;
                    })}
                
            
        );
        const fallback = () =&gt; (<div>...</div>);

        return Maybe.fromNull(items).map(propertyGroup).orSome(fallback());
    }
}
github neos / neos-ui / packages / neos-ui-editors / src / Editors / Image / Utils / index.js View on Github external
get cropAdjustment() {
        const {image} = this;
        return Maybe.fromNull($get(CROP_IMAGE_ADJUSTMENT, image));
    }