@starbeam/modifier
Advanced tools
Comparing version 0.7.4 to 0.8.0
# @starbeam/modifier | ||
## 0.8.0 | ||
### Minor Changes | ||
- 1a553c5: Prepare for 0.8 | ||
### Patch Changes | ||
- Updated dependencies [1a553c5] | ||
- @starbeam/debug@0.8.0 | ||
- @starbeam/interfaces@0.8.0 | ||
- @starbeam/shared@1.3.0 | ||
- @starbeam/universal@0.8.0 | ||
- @starbeam/verify@0.8.0 | ||
## 0.7.4 | ||
@@ -4,0 +19,0 @@ |
@@ -1,4 +0,4 @@ | ||
import { Cell, DelegateInternals } from '@starbeam/core'; | ||
import { REUSE_ID } from '@starbeam/debug'; | ||
import { UNINITIALIZED, REACTIVE } from '@starbeam/shared'; | ||
import { Cell, DelegateInternals } from '@starbeam/universal'; | ||
import { verified, isPresent, verify, expected } from '@starbeam/verify'; | ||
@@ -9,3 +9,3 @@ | ||
const ref = Object.create(null); | ||
const element = Cell(UNINITIALIZED, { | ||
const elementCell = Cell(UNINITIALIZED, { | ||
description: description.implementation(REUSE_ID, { | ||
@@ -15,13 +15,11 @@ reason: "element cell" | ||
}); | ||
REFS.set(ref, element); | ||
REFS.set(ref, elementCell); | ||
return { | ||
[REACTIVE]: DelegateInternals([element]), | ||
[REACTIVE]: DelegateInternals([elementCell]), | ||
initialize(value) { | ||
const element = verified(REFS.get(ref), isPresent); | ||
verify(value, value => value instanceof type, expected(`A ref (${description.describe()})`).toBe(`initialized with an instance of ${type.name}`).butGot(() => `an instance of ${value.constructor.name}`)); | ||
verify(value, anyElement => anyElement instanceof type, expected(`A ref (${description.describe()})`).toBe(`initialized with an instance of ${type.name}`).butGot(() => `an instance of ${value.constructor.name}`)); | ||
element.current = value; | ||
element.freeze(); | ||
}, | ||
get current() { | ||
@@ -31,3 +29,2 @@ const current = verified(REFS.get(ref), isPresent).current; | ||
} | ||
}; | ||
@@ -34,0 +31,0 @@ } |
{ | ||
"name": "@starbeam/modifier", | ||
"version": "0.7.4", | ||
"version": "0.8.0", | ||
"type": "module", | ||
"main": "dist/index.cjs", | ||
"starbeam:type": "library", | ||
"dependencies": { | ||
"@starbeam/core": "^0.7.4", | ||
"@starbeam/debug": "^0.7.4", | ||
"@starbeam/shared": "^1.2.2", | ||
"@starbeam/verify": "^0.7.3", | ||
"@starbeam/interfaces": "^0.7.3" | ||
}, | ||
"devDependencies": { | ||
"@domtree/flavors": "^0.9.1" | ||
}, | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
@@ -24,3 +14,18 @@ ".": { | ||
}, | ||
"types": "dist/index.d.ts" | ||
"starbeam:type": "library:public", | ||
"dependencies": { | ||
"@starbeam/debug": "^0.8.0", | ||
"@starbeam/interfaces": "^0.8.0", | ||
"@starbeam/shared": "^1.3.0", | ||
"@starbeam/universal": "^0.8.0", | ||
"@starbeam/verify": "^0.8.0" | ||
}, | ||
"devDependencies": { | ||
"@domtree/flavors": "^0.9.2", | ||
"@starbeam-dev/build-support": "1.0.0" | ||
}, | ||
"scripts": { | ||
"test:lint": "eslint", | ||
"test:types": "tsc -b" | ||
} | ||
} |
import type { anydom } from "@domtree/flavors"; | ||
import { Cell, DelegateInternals } from "@starbeam/core"; | ||
import { type Description, REUSE_ID } from "@starbeam/debug"; | ||
import type { ReactiveProtocol } from "@starbeam/interfaces"; | ||
import { REACTIVE, UNINITIALIZED } from "@starbeam/shared"; | ||
import { Cell, DelegateInternals } from "@starbeam/universal"; | ||
import { expected, isPresent, verified, verify } from "@starbeam/verify"; | ||
@@ -29,3 +29,3 @@ | ||
const ref = Object.create(null) as object; | ||
const element = Cell<anydom.Element | UNINITIALIZED>(UNINITIALIZED, { | ||
const elementCell = Cell<anydom.Element | UNINITIALIZED>(UNINITIALIZED, { | ||
description: description.implementation(REUSE_ID, { | ||
@@ -36,6 +36,6 @@ reason: "element cell", | ||
REFS.set(ref, element); | ||
REFS.set(ref, elementCell); | ||
return { | ||
[REACTIVE]: DelegateInternals([element]), | ||
[REACTIVE]: DelegateInternals([elementCell]), | ||
@@ -46,3 +46,3 @@ initialize(value: anydom.Element): void { | ||
value, | ||
(value): value is E => value instanceof type, | ||
(anyElement): anyElement is E => anyElement instanceof type, | ||
expected(`A ref (${description.describe()})`) | ||
@@ -49,0 +49,0 @@ .toBe(`initialized with an instance of ${type.name}`) |
{ | ||
"extends": "../../.config/tsconfig/tsconfig.-package.json", | ||
"extends": "../../../.config/tsconfig/tsconfig.shared.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/packages", | ||
"composite": true, | ||
"declaration": true, | ||
"composite": true, | ||
"declarationDir": "../../../dist/types", | ||
"declarationMap": true, | ||
"declarationDir": "../../dist/types", | ||
"types": ["../env"] | ||
} | ||
"outDir": "../../../dist/packages", | ||
"types": ["../../env"] | ||
}, | ||
"exclude": ["dist/**/*"] | ||
} |
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
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
20135
16
149
2
+ Added@starbeam/universal@^0.8.0
+ Added@starbeam/core-utils@0.8.9(transitive)
+ Added@starbeam/debug@0.8.9(transitive)
+ Added@starbeam/interfaces@0.8.9(transitive)
+ Added@starbeam/timeline@0.8.9(transitive)
+ Added@starbeam/universal@0.8.9(transitive)
+ Added@starbeam/verify@0.8.9(transitive)
+ Addedansicolor@1.1.100(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedieee754@1.2.1(transitive)
- Removed@starbeam/core@^0.7.4
- Removed@starbeam/core@0.7.4(transitive)
- Removed@starbeam/core-utils@0.7.3(transitive)
- Removed@starbeam/debug@0.7.4(transitive)
- Removed@starbeam/interfaces@0.7.3(transitive)
- Removed@starbeam/timeline@0.7.4(transitive)
- Removed@starbeam/verify@0.7.3(transitive)
Updated@starbeam/debug@^0.8.0
Updated@starbeam/interfaces@^0.8.0
Updated@starbeam/shared@^1.3.0
Updated@starbeam/verify@^0.8.0