How to use the uniqid.time function in uniqid

To help you get started, we’ve selected a few uniqid 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 breuerfelix / king-bot-api / src / features / finish_earlier.ts View on Github external
set_default_options(): void {
		this.options = {
			uuid: uniqid.time(),
			run: false,
			error: false
		};
	}
github Urigo / WhatsApp-Clone-Client-React / src / graphql-hooks / users-hooks.ts View on Github external
return (options: {
    variables: {
      name?: string;
      picture?: string;
      [key: string]: any;
    }
  }) => {
    const { name, picture } = options.variables

    return changeUser({
      variables: { name, picture },
      optimisticResponse: {
        __typename: 'Mutation',
        changeUserInfo: {
          __typename: 'User',
          id: uniqid(),
          name: name || me.name,
          picture: picture || me.picture,
        }
      },
      update: (store, { data: { changeUserInfo } }) => {
        me.picture = picture || me.picture
        me.name = name || me.name

        store.writeQuery({
          query: getMeQuery,
          data: { me },
        })
      },
      ...options,
    })
  }
github breuerfelix / king-bot-api / frontend / navbar.jsx View on Github external
add_notification(state, message, level) {
		const noti = {
			id: uniqid.time(),
			message,
			level
		};

		return { notifications: [...state.notifications, noti] };
	}
});
github Urigo / WhatsApp-Clone-Client-React / src / components / ChatRoomScreen / MessageBox.tsx View on Github external
export default ({ chatId }: MessageBoxProps) => {
  const [message, setMessage] = useState('')
  const me = useMe()

  const addMessage = useMutation(
    mutation,
    {
      variables: {
        chatId,
        content: message,
      },
      optimisticResponse: {
        __typename: 'Mutation',
        addMessage: {
          id: uniqid(),
          __typename: 'Message',
          chat: {
            id: chatId,
            __typename: 'Chat',
          },
          sender: {
            id: me.id,
            __typename: 'User',
            name: me.name,
          },
          content: message,
          createdAt: new Date(),
          type: 0,
          recipients: [],
          ownership: true,
        },
github vinyguedess / filebaser / src / Collection.js View on Github external
insert(element) {
    element.id = uniqid(uniqid.time() + ".");

    let response = this.data.push(element);

    return response >= 0;
  }
github isflavior / uglify-php / lib / index.js View on Github external
tokens.forEach((token, key) => {
			if(!Array.isArray(token)){
				new_source += token;
				return;
			}

			if (token[0] == 'T_VARIABLE' && options_excludes.indexOf(token[1]) < 0) {
				if(!variables[token[1]]) variables[token[1]] = uniqid.time();
			}

			if (token[0] == 'T_STRING' && typeof tokens[key-2] !== 'undefined' && Array.isArray(tokens[key-2]) && tokens[key-2][1] == "$this") {
				if(!variables["$" + token[1]]) variables["$" + token[1]] = uniqid.time();
			}

			if (token[0] == 'T_STRING' && typeof tokens[key-2] !== 'undefined' && Array.isArray(tokens[key-2]) && tokens[key-2][1] == "function") {
				if(!functions[token[1]]) functions[token[1]] = token[1];
			}

			if (options_minify_remove_comments && (token[0] == 'T_COMMENT' || token[0] == 'T_DOC_COMMENT')) {
				return;
			}

			new_source += token[1];
		});
github breuerfelix / king-bot-api / src / features / auto_adventure.ts View on Github external
set_default_options(): void {
		this.options = {
			uuid: uniqid.time(),
			type: 0,
			min_health: 15,
			run: false,
			error: false
		};
	}
github iamawebgeek / redux-data-entity / src / configureDataEntity.js View on Github external
    keyGenerator: (unit) => uniqid.time(),
    valueExtractor: (unit) => unit,
github breuerfelix / king-bot-api / frontend / sites / edit_feature.jsx View on Github external
add_notification(state, message, level) {
		const noti = {
			id: uniqid.time(),
			message,
			level
		};

		return { notifications: [...state.notifications, noti] };
	}
});

uniqid

Unique ID Generator

MIT
Latest version published 3 years ago

Package Health Score

68 / 100
Full package analysis

Popular uniqid functions