Skip to content

Commit 29a0790

Browse files
committed
added elems access support
1 parent 37422eb commit 29a0790

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Placeload.js renamed to lib/placeload.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const drawIO = (f, _IO) => {
5454
const newElement = document.createElement('div')
5555
styl(newElement).addClass('placeload-masker')
5656
f(elementStyle(elements, newElement))
57-
return elements
57+
return Either.Right({...elements.value, elems: [...elements.value.elems, newElement]})
5858
})
5959
}
6060

@@ -77,7 +77,8 @@ const Placeload = {
7777
container.appendChild(elementPlaceload)
7878
return Either.Right({
7979
container: container,
80-
placeload: elementPlaceload
80+
placeload: elementPlaceload,
81+
elems: []
8182
})
8283
}
8384
return Either.Left(`Don\' found ${x} element`)
@@ -92,5 +93,6 @@ Placeload
9293
.line((element) => element.width(40).height(30))
9394
.config({spaceBetween: '20px'})
9495
.line((element) => element.width(100).height(30))
96+
.config({right: true})
9597
.fold((err) => console.log('error: ', err),
9698
(right) => console.log('sucess: ', right))

0 commit comments

Comments
 (0)