How to use the es6-symbol function in es6-symbol

To help you get started, we’ve selected a few es6-symbol 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 879479119 / Bilibili-React-Native / app / middleware / api.js View on Github external
// We use this Normalizr schemas to transform API responses from a nested form
// to a flat form where repos and users are placed in `entities`, and nested
// JSON objects are replaced with their IDs. This is very convenient for
// consumption by reducers, because we can easily build a normalized tree
// and keep it updated as we fetch more data.

// Read more about Normalizr: https://github.com/paularmstrong/normalizr

// GitHub's API may return results with uppercase letters while the query
// doesn't contain any. For example, "someuser" could result in "SomeUser"
// leading to a frozen UI as it wouldn't find "someuser" in the entities.
// That's why we're forcing lower cases down there.


// Action key that carries API call info interpreted by this Redux middleware.
export const CALL_API = Symbol('Call API')
// A Redux middleware that interprets actions with CALL_API info specified.
// Performs the call and promises when such actions are dispatched.
export default store => next => action => {
  const callAPI = action[CALL_API]

  if (typeof callAPI === 'undefined') {
    return next(action)
  }

  let { endpoint } = callAPI
  const { schema, types } = callAPI

  if (typeof endpoint === 'function') {
    endpoint = endpoint(store.getState())
  }
github Katochimoto / xblocks / src / constants / select.js View on Github external
import Symbol from 'es6-symbol';

export default {
    MENU: Symbol('select-menu'),
    SELECTED: Symbol('select-selected')
};
github Wildhoney / Leaflet.FreeDraw / src / FreeDraw.js View on Github external
* @constant notifyDeferredKey
 * @type {Symbol}
 */
export const notifyDeferredKey = Symbol('freedraw/notify-deferred');

/**
 * @constant edgesKey
 * @type {Symbol}
 */
export const edgesKey = Symbol('freedraw/edges');

/**
 * @constant cancelKey
 * @type {Symbol}
 */
const cancelKey = Symbol('freedraw/cancel');

export default class FreeDraw extends FeatureGroup {

    /**
     * @constructor
     * @param {Object} [options = {}]
     * @return {void}
     */
    constructor(options = defaultOptions) {
        super();
        this.options = { ...defaultOptions, ...options };
    }

    /**
     * @method onAdd
     * @param {Object} map
github Canner / redux-firebase-middleware / src / CALL_FIR_API.js View on Github external
/**
 * @flow
 */

import Symbol from "es6-symbol";
const CALL_API = Symbol("Call Firebase API");

export default CALL_API;
github facebook / react / packages / react-devtools-shared / src / hydration.js View on Github external
import {
  getDataType,
  getDisplayNameForReactElement,
  getInObject,
  formatDataForPreview,
  setInObject,
} from './utils';

import type {DehydratedData} from 'react-devtools-shared/src/devtools/views/Components/types';

export const meta = {
  inspectable: Symbol('inspectable'),
  inspected: Symbol('inspected'),
  name: Symbol('name'),
  preview_long: Symbol('preview_long'),
  preview_short: Symbol('preview_short'),
  readonly: Symbol('readonly'),
  size: Symbol('size'),
  type: Symbol('type'),
  unserializable: Symbol('unserializable'),
};

export type Dehydrated = {|
  inspectable: boolean,
  name: string | null,
  preview_long: string | null,
  preview_short: string | null,
  readonly?: boolean,
  size?: number,
  type: string,
|};
github GetStream / react-native-activity-feed / src / components / StatusUpdateForm.js View on Github external
import KeyboardSpacer from 'react-native-keyboard-spacer';

import type {
  BaseAppCtx,
  CustomActivityArgData,
  StyleSheetLike,
  OgData,
} from '../types';

import type { ActivityArgData } from 'getstream';

const ImageState = Object.freeze({
  NO_IMAGE: Symbol('no_image'),
  UPLOADING: Symbol('uploading'),
  UPLOADED: Symbol('uploaded'),
  UPLOAD_FAILED: Symbol('upload_failed'),
});

const urlRegex = /(https?:\/\/[^\s]+)/gi;

type Props = {|
  /** The feed group part of the feed that the activity should be posted to */
  feedGroup: string,
  /** The user_id part of the feed that the activity should be posted to  */
  userId?: string,
  /** The verb that should be used to post the activity */
  activityVerb: string,
  /** Make the form full screen. This can be useful when you have a separate
   * screen for posting. */
  fullscreen: boolean,
  styles: StyleSheetLike,
  /** Height in pixels for the whole component, if this is not set correctly
github Katochimoto / xblocks / src / constants / popup.js View on Github external
import Symbol from 'es6-symbol';

export default {
    OPTIONS: Symbol('popup-options'),
    CORE: Symbol('popup-core'),
    POPUP: Symbol('popup-popup')
};
github Katochimoto / xblocks / src / constants / menuitem.js View on Github external
import Symbol from 'es6-symbol';

export default {
    FOCUSED: Symbol('menuitem-focused'),
    MENU: Symbol('menuitem-menu'),
    SUBMENU: Symbol('menuitem-submenu'),
    SUBMENU_TIMER: Symbol('menuitem-submenu-timer'),
    SELECTED_ATTR: 'data-xb-selected'
};
github Wildhoney / ReactDelayed / example / js / default.js View on Github external
import React, { Component } from 'react';
import { render } from 'react-dom';
import Symbol from 'es6-symbol';
import Modal from './modal';
import Delayed from '../../src/react-delayed';

/**
 * @constant modalTypes
 * @type {{without: *, with: *}}
 */
const modalTypes = {
    without: Symbol('without'),
    with: Symbol('with')
};

/**
 * @class Example
 * @extends {Component}
 */
class Example extends Component {

    /**
     * @constant state
     * @type {{modal: null}}
     */
    state = { modal: null };

    /**
github GetStream / react-native-activity-feed / src / components / StatusUpdateFormSimple.js View on Github external
Keyboard,
} from 'react-native';
import { StreamContext } from '../Context';
import OgBlock from './OgBlock';
import { pickImage } from '../native';

import { buildStylesheet } from '../styles';
import _ from 'lodash';
import Symbol from 'es6-symbol';
import KeyboardAccessory from 'react-native-sticky-keyboard-accessory';
import KeyboardSpacer from 'react-native-keyboard-spacer';

const ImageState = Object.freeze({
  NO_IMAGE: Symbol('no_image'),
  UPLOADING: Symbol('uploading'),
  UPLOADED: Symbol('uploaded'),
  UPLOAD_FAILED: Symbol('upload_failed'),
});

const urlRegex = /(https?:\/\/[^\s]+)/gi;

export default class StatusUpdateFormSimple extends React.Component {
  static defaultProps = {
    feedGroup: 'user',
    activity_verb: 'post',
    styles: {
      ogBlock: {
        wrapper: {
          padding: 15,
          paddingTop: 8,
          paddingBottom: 8,
          borderTopColor: '#eee',