alchemyOptions.getPostMeta(42,'my-meta-id').then(value=>{ //value is a JSON string like {"success":true,"data":42}});
getPostMeta returns the kew defer, so you can deal with the promise later.
constmyMeta=alchemyOptions.getPostMeta(42,'my-meta-id');//later in the codemyMeta.promise.then(value=>{ // do something with the value});
If for some reason getPostMeta fails, you can deal with it in the fail method. It can happen if the AJAX request errored or was aborted.
alchemyOptions.getPostMeta(42,'my-meta-id').then(value=>{ // value is a JSON string like {"success":true,"data":42}}).fail(response=>{ // failed to get the value});
alchemyOptions
.getPostMeta(121465413561, 'some-meta-id') // ID of a post that doesn't exist
.then(value => {
// value is a JSON string like {"success":true,"data":""}
})