var swim = require("@swim/client");
var structure = require("@swim/structure");
var msg = structure.Text.from('Hello World')
const hostRef = swim.hostRef("warp://localhost:9001");
const client = new swim.WarpClient();
client.command("warp://localhost:9001", "/user/john", "getSurname", msg);
[/user/john] Surname of John is "Hello World"
swim.codec.DecoderException: incomplete
compile group: 'org.swimos', name: 'swim-server', version: '3.10.0'
compile group: 'org.swimos', name: 'swim-api', version: '3.10.0'
compile group: 'org.swimos', name: 'swim-client', version: '3.10.0'
var swim = require("@swim/client");
var structure = require("@swim/structure");
const client = new swim.WarpClient();
let valueLane = client.downlinkValue()
.hostUri("warp://localhost:9001").nodeUri("/welcome/user").laneUri("info")
.didSet((newValue, oldValue) => {
console.log("link watched info change to " + newValue + " from " + oldValue);
})
.open();
let oldvalue = valueLane.get()
valueLane.set("john");
console.log(oldvalue)
client.close()
Im trying to work with value lane. above is the client code. When i run the code the old value comeslink watched info change to john from Value.absent()
). Am i missing anything here. i can see the old and new value in the server side log
console.log(oldvalue)
returns Absent {}
valuelane.set(swim.Value.fromAny("john"))
instead. This will convert your string to a Swim Value.