Skip to content

getNetworkAttributeBuffer

method

Back to Helios Network JS/WASM API

Kind
method
Source
src/js/HeliosNetwork.js:6161

Description

Retrieves a wrapper around the network attribute buffer.

Signature

getNetworkAttributeBuffer(name) {

Parameters

NameTypeAttributesDefaultDescription
namestringAttribute identifier.

Returns

Wrapper providing type information and buffer helpers.

Type Object

Example

const net = await HeliosNetwork.create();
net.defineNetworkAttribute('version', AttributeType.UnsignedInteger);
net.withBufferAccess(() => {
  const attribute = net.getNetworkAttributeBuffer('version');
  attribute.view[0] = 1;
});