How to use the tsmonad.Maybe.nothing function in tsmonad

To help you get started, we’ve selected a few tsmonad 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 Simon-Initiative / authoring-client / src / editors / content / learning / PulloutEditor.tsx View on Github external
onPulloutTypeChange(pulloutType) {
    const model = this.props.model.with({
      pulloutType: pulloutType === ''
        ? Maybe.nothing()
        : Maybe.just(pulloutType),
    });
    this.props.onEdit(model, model);
  }
github Simon-Initiative / authoring-client / src / data / content / workbook / multipanel / multipanel.ts View on Github external
const defaults = (params: Partial = {}) => ({
  contentType: 'Multipanel',
  elementType: 'multipanel',
  guid: params.guid || createGuid(),
  id: params.id || toContentId(createGuid()),
  purpose: params.purpose || Maybe.nothing(),
  title: params.title || Maybe.nothing(),
  imageHotspot: params.imageHotspot || new ImageHotspot(),
  panels: params.panels || Immutable.List(),
  introPanelRef: params.introPanelRef || Maybe.nothing(),
  inline: params.inline || new WbInline(),
});
github Simon-Initiative / authoring-client / src / data / content / workbook / multipanel / panel.ts View on Github external
const defaults = (params: Partial = {}) => ({
  contentType: 'Panel',
  elementType: 'panel',
  guid: params.guid || toContentId(createGuid()),
  id: params.id || createGuid(),
  title: params.title || Maybe.nothing(),
  content: params.content || ContentElements.fromText(
    '', createGuid(), [...INLINE_ELEMENTS, ...CONTROL_ELEMENTS]),
});
github Simon-Initiative / authoring-client / src / data / content / workbook / multipanel / image_hotspot.ts View on Github external
const defaults = (params: Partial = {}) => ({
  contentType: 'ImageHotspot',
  elementType: 'image_hotspot',
  guid: params.guid || createGuid(),
  id: params.id || toContentId(createGuid()),
  src: params.src || 'NO_IMAGE_SELECTED',
  alt: params.alt || '',
  width: params.width || 600,
  height: params.height || 400,
  visibility: params.visibility || Maybe.nothing(),
  hotspots: params.hotspots || Immutable.OrderedMap(),
});
github Simon-Initiative / authoring-client / src / reducers / analytics.ts View on Github external
const defaults = (params: Partial = {}) => ({
  requestedDataSetId: params.requestedDataSetId || Maybe.nothing(),
  dataSet: params.dataSet || Maybe.nothing(),
});
github Simon-Initiative / authoring-client / src / data / content / learning / translation.ts View on Github external
static fromPersistence(root: Object, guid: string, notify: () => void) : Translation {

    const t = (root as any).translation;

    const id = t['@id']
      ? t['@id']
      : (notify(), createGuid());

    const title = t['@title'] !== undefined
      ? Maybe.just(t['@title'])
      : Maybe.nothing();

    return new Translation({
      guid,
      content: ContentElements.fromPersistence(t, '', INLINE_ELEMENTS, null, notify),
      id,
      title,
    });
  }
github Simon-Initiative / authoring-client / src / components / Preview.tsx View on Github external
constructor(props) {
    super(props);

    this.state = { previewUrl: Maybe.nothing() };

    this.timerId = Maybe.nothing();
  }
github Simon-Initiative / authoring-client / src / components / NavigationPanel.tsx View on Github external
constructor(props: StyledComponentProps) {
    super(props);

    this.state = {
      collapsed: false,
      showOrgDropdown: false,
      isResizing: false,
      resizeStart: 0,
      width: Maybe.nothing(),
      newWidth: Maybe.nothing(),
    };
  }
github Simon-Initiative / authoring-client / src / components / Preview.tsx View on Github external
constructor(props) {
    super(props);

    this.state = { previewUrl: Maybe.nothing() };

    this.timerId = Maybe.nothing();
  }
github Simon-Initiative / authoring-client / src / components / CoursesView.tsx View on Github external
constructor(props) {
    super(props);

    this.state = { courses: Maybe.nothing() };
    this.createCourse = this.createCourse.bind(this);
    this.onSelect = (id) => {
      this.props.dispatch(viewActions.viewCourse(id));
    };
  }

tsmonad

TsMonad - fun-size monads library for TypeScript

MIT
Latest version published 7 years ago

Package Health Score

51 / 100
Full package analysis

Popular tsmonad functions