Skip to content

Commit c0a5986

Browse files
committed
add note in legacy readme about why it exists
1 parent c02571f commit c0a5986

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.legacy.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
The legacy API exists to preserve compatibility for users importing the package using a `script` tag. Because [unpkg.com](https://unpkg.com) serves the latest version of the package if no version is specified, I can't break backwards compatibility, even with a major release. This API also preserves a few features that could potentially be still be useful to some users (guide rendering and editable svg).
2+
3+
---
4+
15
## Install
26

37
```ts

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import * as blobs2 from "blobs/v2";
3131

3232
```js
3333
const svgPath = blobs2.svg({
34-
seed: Date.now(),
34+
seed: Math.random(),
3535
extraPoints: 8,
3636
randomness: 4,
3737
size: 256,
@@ -44,7 +44,7 @@ doSomething(svgPath);
4444
```js
4545
const svgString = blobs2.svg(
4646
{
47-
seed: Date.now(),
47+
seed: Math.random(),
4848
extraPoints: 8,
4949
randomness: 4,
5050
size: 256,
@@ -63,7 +63,7 @@ container.innerHTML = svgString;
6363
```js
6464
const path = blobs2.canvasPath(
6565
{
66-
seed: Date.now(),
66+
seed: Math.random(),
6767
extraPoints: 16,
6868
randomness: 2,
6969
size: 128,
@@ -81,7 +81,7 @@ ctx.stroke(path);
8181
```ts
8282
export interface BlobOptions {
8383
// A given seed will always produce the same blob.
84-
// Use `Date.now()` for pseudorandom behavior.
84+
// Use `Math.random()` for pseudorandom behavior.
8585
seed: string | number;
8686
// Actual number of points will be `3 + extraPoints`.
8787
extraPoints: number;

0 commit comments

Comments
 (0)