Skip to content

v2.0.0-alpha4

Pre-release
Pre-release
Compare
Choose a tag to compare
@robotlolita robotlolita released this 25 Jun 16:49
· 193 commits to master since this release

Install it through npm or download the attached zip:

$ npm install --save [email protected]

Documentation

  • Guides for installing and contributing to Folktale were added.
  • An annex describing the type annotation used in Folktale was added.
  • Documentation for Data.Task was added.
  • Other documentation improvements were made.
  • Top-level async/await is now supported in Documentation examples.
  • Experimental features now have a section noting such in their pages.

New features

  • .mapRejected() was added as a counterpart of .map() for failed Tasks
    (35fbd0d)
  • .orElse() was added as a convenient way of recovering from failed Tasks
    (35fbd0d)
  • waitAny and waitAll have been added as convenience over .or and .and methods in Task
    (ea4d1c0)
  • Equality derivation now uses a limited deep-equality (for arrays/objects) by default
    (373b518)

Bug fixes

  • Fixes fromJSON in the presence of getters, where it'd fail when trying to set values in the reified structure
    (f4026e0)
  • Serialises undefined as null so all keys are kept in the serialised structure
    (ffee127)

BREAKING CHANGES

  • (da6c2e3)
    nullable → validation now takes a fallback value, so Failures are kept as semigroups. By default, if you don't pass anything, the fallback value will be undefined, so this only breaks things if you were relying on nullableToValidation(null) giving you Failure(null). To fix it, simply pass an additional parameter:

    // Before
    nullableToValidation(null);
    Validation.fromNullable(null);
    
    // Now
    nullableToValidation(null, null);
    Validation.fromNullable(null, null);

    That said, you should keep your Failures as proper semigroups, so things like .apply and .concat will work correctly.