Skip to content

Instantly share code, notes, and snippets.

@MichalZalecki MichalZalecki/pointsSum.ts Secret
Created Apr 23, 2019

What would you like to do?
import { PathReporter } from "io-ts/lib/PathReporter";
const pointsSum = => post.hits.reduce((s, p) => s + p.points, 0));
if (pointsSum.isRight()) {
console.log(`Sum of points is ${pointsSum.value}`);
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.