@nannanbug/unique-token
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Unique Toke

Generate a increament token. Unique, Readable, Sortable

相应的包可查看

usage

import { Token } from '@nananbug/unique-token'

const VNodeID = new Token('vnode')

const VNodeView = {
  id: `${VNodeID}`,
  type: 'View',
  props: {}
}
// {
//   id: '_vnode__A_',
//   type: 'View',
//   props: {}
// }

VNodeID.generate()
const VNodeImage = {
  id: `${VNodeID}`,
  type: 'Image',
  props: {}
}
// {
//   id: '_vnode__B_',
//   type: 'Image',
//   props: {}
// }

最后

End of the battle

Package Sidebar

Install

npm i @nannanbug/unique-token

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

13.2 kB

Total Files

11

Last publish

Collaborators

  • looading