Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
65fb77ce
Commit
65fb77ce
authored
Jan 30, 2019
by
Hugo Häggmark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a small bug and added case sensitivity
parent
0ddaa95d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
public/app/core/redux/actionCreatorFactory.test.ts
+1
-1
public/app/core/redux/actionCreatorFactory.ts
+2
-1
No files found.
public/app/core/redux/actionCreatorFactory.test.ts
View file @
65fb77ce
...
@@ -46,7 +46,7 @@ describe('actionCreatorFactory', () => {
...
@@ -46,7 +46,7 @@ describe('actionCreatorFactory', () => {
setup
(
payload
);
setup
(
payload
);
expect
(()
=>
{
expect
(()
=>
{
actionCreatorFactory
<
Dummy
>
(
'
dummy
'
).
create
();
actionCreatorFactory
<
Dummy
>
(
'
DuMmY
'
).
create
();
}).
toThrow
();
}).
toThrow
();
});
});
});
});
...
...
public/app/core/redux/actionCreatorFactory.ts
View file @
65fb77ce
...
@@ -21,7 +21,7 @@ export const actionCreatorFactory = <Payload>(type: string): ActionCreatorFactor
...
@@ -21,7 +21,7 @@ export const actionCreatorFactory = <Payload>(type: string): ActionCreatorFactor
return
Object
.
assign
((
payload
:
Payload
):
GrafanaAction
<
Payload
>
=>
({
type
,
payload
}),
{
type
});
return
Object
.
assign
((
payload
:
Payload
):
GrafanaAction
<
Payload
>
=>
({
type
,
payload
}),
{
type
});
};
};
if
(
allActionCreators
.
some
(
t
=>
type
===
type
))
{
if
(
allActionCreators
.
some
(
t
=>
(
t
&&
type
?
t
.
toLocaleUpperCase
()
===
type
.
toLocaleUpperCase
()
:
false
)
))
{
throw
new
Error
(
`There is already an actionCreator defined with the type
${
type
}
`
);
throw
new
Error
(
`There is already an actionCreator defined with the type
${
type
}
`
);
}
}
...
@@ -30,4 +30,5 @@ export const actionCreatorFactory = <Payload>(type: string): ActionCreatorFactor
...
@@ -30,4 +30,5 @@ export const actionCreatorFactory = <Payload>(type: string): ActionCreatorFactor
return
{
create
};
return
{
create
};
};
};
// Should only be used by tests
export
const
resetAllActionCreatorTypes
=
()
=>
(
allActionCreators
.
length
=
0
);
export
const
resetAllActionCreatorTypes
=
()
=>
(
allActionCreators
.
length
=
0
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment