Skip to content

Commit

Permalink
Allow overriding a store and action name
Browse files Browse the repository at this point in the history
  • Loading branch information
goatslacker committed Apr 19, 2015
1 parent aedabf4 commit c91bb1e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/alt-with-addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ var Alt = (function () {
args[_key - 2] = arguments[_key];
}

var key = iden || StoreModel.name || StoreModel.displayName || "";
var key = iden || StoreModel.displayName || StoreModel.name || "";

if (this.stores[key] || !key) {
if (this.stores[key]) {
Expand Down Expand Up @@ -1350,7 +1350,7 @@ var Alt = (function () {
var exportObj = arguments[1] === undefined ? {} : arguments[1];

var actions = {};
var key = ActionsClass.name || ActionsClass.displayName || "";
var key = ActionsClass.displayName || ActionsClass.name || "";

if (typeof ActionsClass === "function") {
(function () {
Expand Down
4 changes: 2 additions & 2 deletions dist/alt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ var Alt = (function () {
args[_key - 2] = arguments[_key];
}

var key = iden || StoreModel.name || StoreModel.displayName || "";
var key = iden || StoreModel.displayName || StoreModel.name || "";

if (this.stores[key] || !key) {
if (this.stores[key]) {
Expand Down Expand Up @@ -1529,7 +1529,7 @@ var Alt = (function () {
var exportObj = arguments[1] === undefined ? {} : arguments[1];

var actions = {};
var key = ActionsClass.name || ActionsClass.displayName || "";
var key = ActionsClass.displayName || ActionsClass.name || "";

if (typeof ActionsClass === "function") {
(function () {
Expand Down
4 changes: 2 additions & 2 deletions src/alt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Alt {
}

createStore(StoreModel, iden, ...args) {
let key = iden || StoreModel.name || StoreModel.displayName || ''
let key = iden || StoreModel.displayName || StoreModel.name || ''

if (this.stores[key] || !key) {
if (this.stores[key]) {
Expand Down Expand Up @@ -107,7 +107,7 @@ class Alt {

createActions(ActionsClass, exportObj = {}, ...argsForConstructor) {
const actions = {}
const key = ActionsClass.name || ActionsClass.displayName || ''
const key = ActionsClass.displayName || ActionsClass.name || ''

if (typeof ActionsClass === 'function') {
assign(actions, getInternalMethods(ActionsClass.prototype, true))
Expand Down

0 comments on commit c91bb1e

Please sign in to comment.