How to use the monet.Maybe.None 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 aappddeevv / dynamics-client-ui / packages / dynamics-client-ui / src / Dynamics / EntityForm.tsx View on Github external
// get Dynamics attribute
        const attribute = getAttribute(logicalName)
        if (attribute) {
            const token = ctx => onChangeHandler(logicalName, attribute.getValue())
            attribute.addOnChange(token)
            // set hasValue
            const value = attribute.getValue()
            const hasValue = attribute ? (value !== null) : false
            return Maybe.Some({
                name: logicalName, logicalName, attribute, hasValue, unregisterToken: token, value,
            } as Attribute)
        }
        else {
            // throw an error?
            if (DEBUG) console.log("connect: Unable to connect:", logicalName)
            return Maybe.None>()
        }
    }).filter(aOpt => aOpt.isSome()).map(aOpt => aOpt.some())
    return { ...state, ...normalizeWith("logicalName", x) }
github aappddeevv / dynamics-client-ui / packages / dynamics-client-ui-react / src / components / AddressManager / AddressEditor.tsx View on Github external
constructor(props) {
        super(props)
        this.state = {
            items: [],
            selected: Maybe.None(),
            buffer: Maybe.None(),
            changed: [],
        }
        this.selection = new Selection({
            onSelectionChanged: this.onSelectionChanged,
            // only used on setItems, so useless in restricting selection
            //canSelectItem: this.canSelectItem,
        })
    }
    private selection: ISelection
github aappddeevv / dynamics-client-ui / packages / dynamics-client-ui-react / src / components / AddressManager / AddressEditor.tsx View on Github external
constructor(props) {
        super(props)
        this.state = {
            items: [],
            selected: Maybe.None(),
            buffer: Maybe.None(),
            changed: [],
        }
        this.selection = new Selection({
            onSelectionChanged: this.onSelectionChanged,
            // only used on setItems, so useless in restricting selection
            //canSelectItem: this.canSelectItem,
        })
    }
    private selection: ISelection
github aappddeevv / dynamics-client-ui / packages / dynamics-client-ui-react / src / components / AddressManager / AddressEditor.tsx View on Github external
protected refresh = async () => {
        return setStatePromise(this, {
            buffer: Maybe.None(),
            selected: Maybe.None(),
        }).then(() => {
            this.sorted = []
            return this.getData(this.props.entityId)
        })
    }