Skip to content

Instantly share code, notes, and snippets.

@gladimdim
Created December 18, 2017 12:36
Show Gist options
  • Save gladimdim/a899fd57d6de5b952debf50396c0bdb8 to your computer and use it in GitHub Desktop.
Save gladimdim/a899fd57d6de5b952debf50396c0bdb8 to your computer and use it in GitHub Desktop.
Encode Reason records back into JSON
module MetricEncoder = {
let encodeCountMetricWithLabel = (m: metricWithLabel) =>
Json.Encode.(object_([("type", string(m.type_)), ("label", string(m.label))]));
let encodeCountMetric = (m: metricCount) => Json.Encode.(object_([("type", string(m.type_))]));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment