How to use the immutable.Seq function in immutable

To help you get started, we’ve selected a few immutable 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 GitbookIO / repofs / src / utils / filestree.js View on Github external
function pathToKeySeq(path) {
    // Remove trailing '/' etc.
    path = Path.join(path, '.');
    if (path === '.') {
        return Immutable.Seq([]);
    } else {
        return Immutable.Seq(path.split('/'));
    }
}
github euphoria-io / heim / client / lib / stores / chat.js View on Github external
_handleWhoReply(data) {
    // TODO: merge instead of reset so we don't lose lastSent
    this.state.who = Immutable.OrderedMap(
      Immutable.Seq(data.listing)
        .map(user => {
          user.present = true
          user.hue = hueHash.hue(user.name)
          return [user.session_id, Immutable.Map(user)]
        })
    )
  },
github int128 / bntp / src / repositories / ChromeAppRepository.js View on Github external
*findFolders() {
    return Seq.of(
      new Folder({
        id: 'App',
        title: 'Chrome Apps',
        items: Seq(yield this.chrome.management.getAll())
          .filter(management => /\w+_app/.test(management.type))
          .map(app => new ChromeApp({
            id: app.id,
            title: app.name,
            icons: app.icons,
          }))
      })
    );
  }
github cvdlab / react-planner / src / components / properties-editor / properties-editor.jsx View on Github external
case 'number':
          return ;

        case 'string':
        default:
          return 

      }
    };


    return (
      <div>
          { Seq(state).entrySeq().map(([propertyName, {currentValue, inputElement, configs}]) =&gt;
              renderInputElement(inputElement, propertyName, currentValue, configs)) }

        <div style="{STYLE_WRAPPER_BUTTONS}">
          <button style="{STYLE_BUTTON_UNSELECT}"> editingActions.unselectAll()}&gt;Unselect</button>
          <button style="{STYLE_BUTTON_REMOVE}"> editingActions.remove()}&gt;Remove</button>
          <button style="{STYLE_BUTTON_RESET}"> this.reset()}&gt;Reset</button>
          <button style="{STYLE_BUTTON_SAVE}"> this.save()}&gt;Save</button>
        </div>
      </div>
    )
  }
github swagger-api / swagger-ui / src / core / components / response.jsx View on Github external
{isOAS3 &amp;&amp; response.get("content") ? (
            <section>
              <div>
                <small>
                  Media type
                </small>
                
                {controlsAcceptHeader ? (
                  <small>
                    Controls <code>Accept</code> header.
                  </small>
                ) : null}
              </div>
              {examplesForMediaType ? (
                <div>
                  <small>
                    Examples
                  </small>
                  </div></section>
github pekkis / hardcore-react-training / server / src / services / util.js View on Github external
export const slowifyAll = (min, max) => service =>
  Seq(service)
    .map(slowify(min, max))
    .toJS();
github int128 / bntp / src / models / index.js View on Github external
}

const BookmarkRecord = Record({
  id: null,
  title: null,
  link: null,
  canEdit: false,
});

export class Bookmark extends BookmarkRecord {
}

const BookmarkFolderRecord = Record({
  id: null,
  title: null,
  bookmarks: Seq(),
});

export class BookmarkFolder extends BookmarkFolderRecord {
}

const BookmarkTreeRecord = Record({
  children: [],
  canEdit: false,
});

export class BookmarkTree extends BookmarkTreeRecord {
  flatten() {
    const canEdit = this.canEdit;
    function traverse(parent) {
      const children = Seq(parent.children);
      const bookmarkFolders = children.filter(child => child.url === undefined).flatMap(traverse);
github HubSpot / transmute / src / internal / _sortBy.js View on Github external
sortBy.implement(Array, (getSortValue, arr) => {
  return Seq(arr)
    .sortBy(getSortValue)
    .toArray();
});
github keybase / client / shared / route-tree / index.js View on Github external
export function routeSetState (routeDef: RouteDefNode, routeState: RouteStateNode, path: Path, partialState: {}): RouteStateNode {
  const pathSeq = I.Seq(path)
  if (!pathSeq.size) {
    return routeState.update('state', state => state.merge(partialState))
  }
  return routeState.updateChild(pathSeq.first(), childState => {
    if (!childState) {
      throw new InvalidRouteError(`Missing state child: ${pathSeq.first()}`)
    }
    return routeSetState(routeDef, childState, pathSeq.skip(1), partialState)
  })
}