How to use the react-native-uuid.v4 function in react-native-uuid

To help you get started, we’ve selected a few react-native-uuid 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 billmalarky / react-native-image-cache-hoc / lib / imageCacheHoc.js View on Github external
constructor(props) {
      super(props);

      // Set initial state
      this.state = {
        localFilePath: null
      };

      // Assign component unique ID for cache locking.
      this.componentId = uuid.v4();

      // Track component mount status to avoid calling setState() on unmounted component.
      this._isMounted = false;

      // Set default options
      this.options = {
        validProtocols: options.validProtocols || ['https'],
        fileHostWhitelist: options.fileHostWhitelist || [],
        cachePruneTriggerLimit: options.cachePruneTriggerLimit || 1024 * 1024 * 15, // Maximum size of image file cache in bytes before pruning occurs. Defaults to 15 MB.
        fileDirName: options.fileDirName || null, // Namespace local file writing to this directory. Defaults to 'react-native-image-cache-hoc'.
        defaultPlaceholder: options.defaultPlaceholder || null, // Default placeholder component to render while remote image file is downloading. Can be overridden with placeholder prop. Defaults to <img> component with style prop passed through.
      };

      // Init file system lib
      this.fileSystem = FileSystemFactory(this.options.cachePruneTriggerLimit, this.options.fileDirName);
github cookpad / react-native-puree / src / queue.ts View on Github external
async push (data: any): Promise {
    if (!this.buffer) await this.init()

    const item = { uuid: uuid.v4(), data }
    this.buffer.push(item)
    await this.sync()
    return item
  }
github eltcoin / eltwallet / src / utils / constants.js View on Github external
import uuid from 'react-native-uuid';

const defaultTokens = [
  {
    contractAddress: '0x44197a4c44d6a059297caf6be4f7e172bd56caaf',
    decimals: 8,
    id: uuid.v4(),
    name: 'ELTCOIN',
    symbol: 'ELT',
  },
  {
    name: 'Ethereum',
    id: uuid.v4(),
    symbol: 'ETH',
  },
];

const erc20Abi = [
  {
    name: 'balanceOf',
    type: 'function',
    constant: true,
    payable: false,
github billmalarky / react-native-queue / Models / Queue.js View on Github external
this.realm.write(() => {

      this.realm.create('Job', {
        id: uuid.v4(),
        name,
        payload: JSON.stringify(payload),
        data: JSON.stringify({
          attempts: options.attempts || 1
        }),
        priority: options.priority || 0,
        active: false,
        timeout: (options.timeout >= 0) ? options.timeout : 25000,
        created: new Date(),
        failed: null
      });

    });
github ak1394 / react-native-login / src / index.js View on Github external
getLoginURL() {
    const {redirect_uri, client_id, kc_idp_hint} = this.conf;
    const response_type = 'code';
    const state = uuid.v4();
    const url = this.getRealmURL() + '/protocol/openid-connect/auth?' + querystring.stringify({
      kc_idp_hint,
      redirect_uri,
      client_id,
      response_type,
      state,
    });

    return {url, state};
  }
github eltcoin / eltwallet / src / utils / constants.js View on Github external
import uuid from 'react-native-uuid';

const defaultTokens = [
  {
    name: 'Ethereum',
    id: uuid.v4(),
    symbol: 'ETH',
  },
];

const erc20Abi = [
  {
    name: 'balanceOf',
    type: 'function',
    constant: true,
    payable: false,
    inputs: [
      {
        name: '_owner',
        type: 'address',
      },
    ],
github eltcoin / eltwallet / src / config / store.js View on Github external
availableTokens: state.availableTokens.map(token => ({
      ...token,
      id: uuid.v4(),
    })),
  }),
github guoxunbo / newbiest / newbiest-client / src / api / RequestHeader.js View on Github external
constructor(messageName){  
        let sessionContext = SessionContext.getSessionContext();
        this.messageName = messageName;
        this.transactionId = uuid.v4();
        if (sessionContext) {
            this.orgRrn = sessionContext.orgRrn;
            this.username = sessionContext.username;
            this.token = SessionContext.getToken();
        } 
    }
github eltcoin / eltwallet / src / config / reducer.js View on Github external
const appReducer = (state = defaultState, action) => {
  switch (action.type) {
    case ADD_TOKEN:
      AnalyticsUtils.trackEvent('Add custom token', {
        contractAddress: action.token.contractAddress,
        decimals: action.token.decimals,
        name: action.token.name,
        symbol: action.token.symbol,
      });

      return {
        ...state,
        availableTokens: state.availableTokens.concat([
          Object.assign(
            action.token,
            { id: uuid.v4() },
            action.token.name === 'ELTCOIN'
              ? {
                  symbol: 'ELT',
                }
              : {},
          ),
        ]),
      };
    case DELETE_TOKEN:
      return {
        ...state,
        availableTokens: state.availableTokens.filter(
          token => token.id !== action.token.id,
        ),
        selectedToken: state.availableTokens[0],
      };

react-native-uuid

react-native-uuid is a zero-dependency TypeScript implementation of RFC4122.

MIT
Latest version published 8 months ago

Package Health Score

75 / 100
Full package analysis

Popular react-native-uuid functions