Skip to content

Instantly share code, notes, and snippets.

@sanemat
Created April 30, 2015 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanemat/5ecf9a5ebb7d02153bef to your computer and use it in GitHub Desktop.
Save sanemat/5ecf9a5ebb7d02153bef to your computer and use it in GitHub Desktop.
async constructor
export class ConfigStore extends Store {
  async constructor(flux) {
    super();

    this.state = { settings: Immutable.fromJS(this.setUpDefault(defaultValues))};

    /*
     Registering action handlers
     */

    const configActionIds = flux.getActionIds('config');

    this.register(configActionIds.saveSettings, this.saveSettings);
    this.register(configActionIds.clearAllData, this.clearAllData);

    await this.overrideByPersistedData();
  }
//snip
}
ERROR in ./src/scripts/stores/ConfigStore.js
Module parse failed: /Users/sane/work/js-study/close-your-issues/node_modules/react-hot-loader/index.js!/Users/sane/work/js-study/close-your-issues/node_modules/babel-loader/index.js?stage=1&optional=runtime!/Users/sane/work/js-study/close-your-issues/src/scripts/stores/ConfigStore.js Line 83: Unexpected token this
You may need an appropriate loader to handle this file type.
|     this.register(configActionIds.clearAllData, this.clearAllData);
| 
|     await this.overrideByPersistedData();
|   }
| 
 @ ./src/scripts/flux/AppFlux.js 25:19-51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment