Features

Key features that make up the main value proposition for Lore

404 Pages

Useful for providing the user with a clear indication that what they're looking for does not exist, as infinite loaders and blank pages are both poor user experiences.

Visualization

This video demonstrates what 404 pages look like. Screenshots are from the Simply Social prototype that Invision provides you when you sign up for an account.

Usage

Lore handles 404 errors by treating them as a special case of Error Handling. Normally if you were fetching a post with an id of 1, and the API returned a 404 status code, the action creator blueprint would emit an action with a payload that looks like this:

model = {
  id: 1,
  cid: 'c1',
  state: 'ERROR_FETCHING',
  data: {},
  error: {
    statusCode: 404,
    message: 'No Post exists with id of 1'
  }
}

But since 404 errors have a clear and explicit use (the resource you asked for does not exist) the default blueprints treat this as a special case and set the state to NOT_FOUND. So instead of the generic error message above the payload will contain this more specific error message:

model = {
  id: 1,
  cid: 'c1',
  state: 'NOT_FOUND',
  data: {},
  error: {
    statusCode: 404,
    message: 'No Post exists with id of 1'
  }
}

This in turn allows you to communicate "not found" experiences much easier to a user:

createReactClass({

  propTypes: {
    post: React.PropTypes.object.isRequired
  },

  render: function() {
    var post = this.props.post;

    if (posts.state === PayloadStates.NOT_FOUND) {
      return (
        <div>
          The Post you requested does not exist.
        </div>
      );
    }

    // todo: render RESOLVED state
  }
});