Skip to content

arraybuffer not working #310

Answered by Tao-VanJS
HEAVYPOLY asked this question in Q&A
Discussion options

You must be logged in to vote

I just released VanX 0.6.0 (#311), which adds a new function vanX.noreactive to exempt certain fields from reactivity conversion. With the new function, the following code can work properly in VanX 0.6.0:

const {div} = van.tags

const data = vanX.reactive([
  vanX.noreactive(new ArrayBuffer(8)),
  vanX.noreactive(new ArrayBuffer(16)),
])

const App = () => div(
  vanX.list(div, data, v => div(v.val.byteLength)),
  div(button({onclick: () => data.push(vanX.noreactive(new ArrayBuffer(24)))}, "Push")),
)

van.add(document.body, App())

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Tao-VanJS
Comment options

You must be logged in to vote
0 replies
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
3 participants