Skip to content

Custom spark ID generator

Compare
Choose a tag to compare
@lpinca lpinca released this 23 Jul 06:39
· 205 commits to master since this release

In this release, we've added the ability to use a custom ID generator for the Spark objects.

A custom spark ID generator can be provided by setting the idGenerator option to a function that returns a unique string each time it is invoked.

const primus = new Primus(server, { idGenerator: () => uuid() });

Thanks to @nanowizard for suggesting and implementing (#601) this useful feature.