Open
Description
Hey there!
I had a similar idea a while ago, but realized that without operator overloading this isn't a complete abstraction. Eg.
import {Map} from 'immutable-proxy'
const a = new Map({b: 1})
a.b = 2
assert(a.b == 2) // we just mutated a!
If we had operator overloading, we could do this, though it feels strange in JS:
import {Map} from 'immutable-proxy'
const a = new Map({b: 1})
const b = a.b = 2
assert(a.b == 1)
assert(b.b == 2)
assert(a != b)
Anyway, I ended up with this proof of concept: https://github.com/bcherny/auditable - mutable datatypes, backed by immutable data structures.
Metadata
Metadata
Assignees
Labels
No labels