Skip to content

Typings and fixes

Choose a tag to compare

@ulfryk ulfryk released this 19 Apr 06:03
· 256 commits to develop since this release
  • [new] add TypeScript typings
  • [new] add .ap() to List, Free and NonEmptyList -- thanks to @WojciechP ( #44 )
  • [new] add "use strict"; -- thanks to @krjackso ( #41 )

Typings

TypeScript typings added to repository, so now anyone can:

import { Maybe } from 'monet';

export function getStoredData(key: string): Maybe<SomeData> {
  return Maybe.fromNull(localStorage)
    .flatMap(ls => Maybe.fromNull(ls.getItem(key)))
    .map(JSON.parse);
}