asString option broken in re-base 3.x
motlin opened this issue · 2 comments
motlin commented
This code broke when upgrading from rebase 2.7.1 to 3.0.2.
this.nameRef = base.bindToState('/some/path/name', {
context : this,
state : 'name',
asString : true,
onFailure: console.log,
});
Specifically, the asString option used to make sure I got back a string or undefined. Now I'm getting back an empty object.
qwales1 commented
@motlin in 3.x asString
was removed and its now defaultValue
which will give you back whatever you set it to in the case of no data. defaultValue: ''
would be equivalent to asString: true
motlin commented
Thank you for the help! I saw defaultValue
but didn't realize they were related.