Skip to main content

ObservedString

ObservedString

Observable string container. Signals change via onChanged.

Kind: global class
Author: Alex Goldring
Copyright: Company Named Limited (c) 2025

new ObservedString([value])

ParamTypeDefault
[value]string""""

Example

const name = new ObservedString("Alice")
name.onChanged((new_name, old_name) => console.log(`Name changed from ${old_name} to ${new_name}!`));
...
name.set("Barbara"); // will print "Name changed from Alice to Barbara!" in console
name.getValue() === "Barbara"

observedString.onChanged : Signal.<string, string>

Kind: instance property of ObservedString

observedString.isObservedString : boolean

Used for optimized "instanceof" check

Kind: instance property of ObservedString
Read only: true

observedString.valueOf() ⇒ string

Kind: instance method of ObservedString

observedString.toString() ⇒ string

Kind: instance method of ObservedString

observedString.set(value) ⇒ ObservedString

Kind: instance method of ObservedString

ParamType
valuestring

observedString.copy(other)

Kind: instance method of ObservedString

ParamType
otherObservedString

observedString.clone() ⇒ ObservedString

Kind: instance method of ObservedString

observedString.getValue() ⇒ string

Kind: instance method of ObservedString

observedString.process(f, [thisArg]) ⇒ this

Kind: instance method of ObservedString

ParamType
ffunction
[thisArg]*

observedString.toBinaryBuffer(buffer)

use buffer.writeUTF8String directly instead

Kind: instance method of ObservedString

ParamType
bufferBinaryBuffer

observedString.fromBinaryBuffer(buffer)

use buffer.readUTF8String directly instead

Kind: instance method of ObservedString

ParamType
bufferBinaryBuffer

observedString.equals(other) ⇒ boolean

Kind: instance method of ObservedString

ParamType
otherObservedString

observedString.hash() ⇒ number

Kind: instance method of ObservedString

ObservedString.typeName : string

Kind: static property of ObservedString
Read only: true