Rename domLens to domProxy / domArray

This commit is contained in:
Talia 2024-02-06 22:02:29 +01:00
parent 39012902e0
commit 0a80d860df
Signed by: darkwiiplayer
GPG Key ID: 7808674088232B3E
1 changed files with 3 additions and 5 deletions

View File

@ -1,5 +1,5 @@
export const lens = (methods, extra) => {
if (extra) return lens(extra)(methods)
export const domArray = (methods, extra) => {
if (extra) return domArray(extra)(methods)
const traps = {
get(target, prop) {
@ -55,9 +55,7 @@ export const lens = (methods, extra) => {
}
return element => {
if (!(element instanceof Element)) throw(new Error("Creating domLens on non-element"))
if (!(element instanceof Element)) throw(new Error("Creating domArray on non-element"))
return new Proxy(element, traps)
}
}
export default lens