janstuemmel/campfhir-server

View on GitHub
campfhir/app/stores/resource.js

Summary

Maintainability
A
0 mins
Test Coverage
import { Store } from 'reflux';

import ResourceActions from '../actions/resource';

class ResourceStore extends Store {

  constructor() {
    super();
    this.state = { data: {}, err: null };
    this.listenables = ResourceActions;
  }

  onGetCompleted(data) {
    this.setState({ data: data, err: null });
  }

  onGetFailed(err) {
    this.setState({ data: {}, err: err });
  }
}

module.exports = ResourceStore;