Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
inventory-frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
coding-brunch-hh
inventory-frontend
Commits
ad32ba48
Commit
ad32ba48
authored
Aug 16, 2018
by
Martin Fahl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removes selector
parent
4fa1456a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
16 deletions
+1
-16
src/container/InventoryListContainer/InventoryListContainer.js
...ontainer/InventoryListContainer/InventoryListContainer.js
+1
-16
No files found.
src/container/InventoryListContainer/InventoryListContainer.js
View file @
ad32ba48
...
@@ -2,7 +2,6 @@ import React, { Component } from 'react'
...
@@ -2,7 +2,6 @@ import React, { Component } from 'react'
import
{
connect
}
from
'
react-redux
'
import
{
connect
}
from
'
react-redux
'
import
InventoryList
from
'
../../components/InventoryList/InventoryList
'
import
InventoryList
from
'
../../components/InventoryList/InventoryList
'
import
{
openAddDialog
}
from
'
../../actions
'
import
{
openAddDialog
}
from
'
../../actions
'
import
{
createSelector
}
from
'
reselect
'
class
InventoryListContainer
extends
Component
{
class
InventoryListContainer
extends
Component
{
render
()
{
render
()
{
...
@@ -12,22 +11,8 @@ class InventoryListContainer extends Component {
...
@@ -12,22 +11,8 @@ class InventoryListContainer extends Component {
}
}
}
}
const
getItems
=
state
=>
state
.
items
;
const
getFilterTerm
=
state
=>
state
.
filterTerm
;
const
getItemsFilteredByTerm
=
createSelector
(
[
getFilterTerm
,
getItems
],
(
filterTerm
,
items
)
=>
{
if
(
filterTerm
===
undefined
)
{
return
items
;
}
else
{
return
items
.
filter
(
item
=>
item
.
name
.
toLowerCase
().
includes
(
filterTerm
.
toLowerCase
()));
}
}
)
const
mapStateToProps
=
state
=>
({
const
mapStateToProps
=
state
=>
({
items
:
getItemsFilteredByTerm
(
state
)
/* TODO map items */
})
})
const
mapDispatchToProps
=
dispatch
=>
({
const
mapDispatchToProps
=
dispatch
=>
({
...
...
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