Skip to content

Releases: FoxComm/wings

clearErrorsFor and more stable `failed` action

24 Feb 17:39
Compare
Choose a tag to compare

Two things in this release:

  1. New action clearErrorsFor was introduced:

    import { clearErrorsFor } from '@foxcomm/wings';
    
    class Foo extends Component {
    componentDidMount() {
       this.props.fetchProducts();
       this.props.fetchTags();
    }
    
    componentWillUnmount() {
      this.props.dispatch(clearErrorsFor('fetchProducts', 'fetchTags'));
    }
    }
    
    export default connect()(Foo);
  2. Fixed failed action, now it doesn't depend on payload reducer for your async action.

derived addAsyncReducer method

27 Dec 12:23
Compare
Choose a tag to compare

Now makeLocalStore doesn't apply asyncReducer by default. In order to do same behaviour you should call new exported method addAsyncReducer to your reducer. Like this:

export _.flowRight(
  makeLocalStore(addAsyncReducer(reducer)), // async state will be available in `asyncActions` namespace
  connect(...)
)(SuperAwesomeComponent);

Or, in order to have async state directly in root state object:

export _.flowRight(
  makeLocalStore(addAsyncReducer(reducer, null)), // async state will be available as is, without any namespace
  connect(...)
)(SuperAwesomeComponent);

Added sanitizeError method to ErrorAlerts

22 Dec 10:50
Compare
Choose a tag to compare

Now you can do this:

function sanitizeError(err: string): string {
  if (err.startsWith('Items out of stock')) {
     return 'Unable to checkout — item is out of stock';
  }
}

return (
  <ErrorAlerts
    error={props.error}
    sanitizeError={sanitizeError}
  />
);

paragons invinted

12 Dec 19:20
Compare
Choose a tag to compare

skuIdentity method added

v1.6.0

09 Dec 16:03
Compare
Choose a tag to compare
1.6.0