Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guid demo #656

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Guid demo #656

wants to merge 2 commits into from

Conversation

Lyumih
Copy link
Contributor

@Lyumih Lyumih commented Jan 11, 2024

No description provided.

$mol_guid_demo $mol_example_code
code? \
\const id = $mol_guid() // K6L1ARD7
\const id_short = $mol_guid(4) // G6AN
Copy link
Member

@nin-jin nin-jin Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 А пример использования второго параметра не добавишь?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не понял какой пример там должен быть.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/hyoo-ru/mam_mol/blob/master/guid/guid.ts#L6

насколько понял, можно передать функцию валидатор для избежания повторов

что-то вроде такого

const exist_guid_list = ["jin", "koplenov"]
function exist(id) {
	return exist_guid_list.includes(id)
	// or you can check id this in database
}

$mol_guid(4, exist)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants