Comparing version 0.1.3 to 0.1.4-canary.3bc6bc1
{ | ||
"name": "signia", | ||
"private": false, | ||
"description": "A tiny little drawing reactive state management library.", | ||
"version": "0.1.3", | ||
"author": "tldraw GB Ltd.", | ||
"license": "MIT", | ||
"homepage": "https://tldraw.dev", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/tldraw/signia" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/tldraw/signia/issues" | ||
}, | ||
"main": "dist/cjs/index.cjs", | ||
"scripts": { | ||
"test": "jest", | ||
"test:coverage": "jest --coverage", | ||
"typecheck": "tsc --build", | ||
"prepack": "tsx ../../scripts/prepack.ts", | ||
"postpack": "../../scripts/postpack.sh", | ||
"build-docs": "typedoc --plugin typedoc-plugin-markdown --out docs src/index.ts --excludePrivate --excludeInternal --readme none --githubPages false --entryDocument index.md --hideBreadcrumbs", | ||
"build": "tsx ../../scripts/build-package.ts" | ||
}, | ||
"jest": { | ||
"preset": "../../jest-preset.js" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash": "^4.14.188", | ||
"lodash": "^4.17.21" | ||
}, | ||
"typedoc": { | ||
"readmeFile": "none", | ||
"entryPoint": "./src/index.ts", | ||
"displayName": "signia", | ||
"tsconfig": "./tsconfig.json" | ||
}, | ||
"gitHead": "b34e04da765300f76947b411d032a4bb714c127e", | ||
"module": "dist/esm/index.mjs", | ||
"source": "src/index.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.mjs", | ||
"require": "./dist/cjs/index.cjs" | ||
} | ||
}, | ||
"files": [ | ||
"dist", | ||
"src" | ||
] | ||
"name": "signia", | ||
"private": false, | ||
"description": "A tiny little drawing reactive state management library.", | ||
"version": "0.1.4-canary.3bc6bc1", | ||
"author": "tldraw GB Ltd.", | ||
"license": "MIT", | ||
"homepage": "https://tldraw.dev", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/tldraw/signia" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/tldraw/signia/issues" | ||
}, | ||
"main": "dist/cjs/index.cjs", | ||
"jest": { | ||
"preset": "../../jest-preset.js" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash": "^4.14.188", | ||
"lodash": "^4.17.21" | ||
}, | ||
"typedoc": { | ||
"readmeFile": "none", | ||
"entryPoint": "./src/index.ts", | ||
"displayName": "signia", | ||
"tsconfig": "./tsconfig.json" | ||
}, | ||
"module": "dist/esm/index.mjs", | ||
"source": "src/index.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.mjs", | ||
"require": "./dist/cjs/index.cjs" | ||
} | ||
}, | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"scripts": { | ||
"test": "jest", | ||
"test:coverage": "jest --coverage", | ||
"typecheck": "tsc --build", | ||
"build-docs": "typedoc --plugin typedoc-plugin-markdown --out docs src/index.ts --excludePrivate --excludeInternal --readme none --githubPages false --entryDocument index.md --hideBreadcrumbs", | ||
"build": "tsx ../../scripts/build-package.ts" | ||
} | ||
} |
@@ -590,1 +590,22 @@ import { atom } from '../Atom.js' | ||
}) | ||
describe('computed isEqual', () => { | ||
it('does not get called for the initialization', () => { | ||
const isEqual = jest.fn((a, b) => a === b) | ||
const a = atom('a', 1) | ||
const b = computed('b', () => a.value * 2, { isEqual }) | ||
expect(b.value).toBe(2) | ||
expect(isEqual).not.toHaveBeenCalled() | ||
expect(b.value).toBe(2) | ||
expect(isEqual).not.toHaveBeenCalled() | ||
a.set(2) | ||
expect(b.value).toBe(4) | ||
expect(isEqual).toHaveBeenCalledTimes(1) | ||
expect(b.value).toBe(4) | ||
expect(isEqual).toHaveBeenCalledTimes(1) | ||
}) | ||
}) |
@@ -184,3 +184,3 @@ /* eslint-disable prefer-rest-params */ | ||
const newState = result instanceof WithDiff ? result.value : result | ||
if (!this.isEqual(newState, this.state)) { | ||
if (this.state === UNINITIALIZED || !this.isEqual(newState, this.state)) { | ||
if (this.historyBuffer && !isNew) { | ||
@@ -187,0 +187,0 @@ const diff = result instanceof WithDiff ? result.diff : undefined |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
328745
5169