diff --git a/app/components/TransfersGraph.jsx b/app/components/TransfersGraph.jsx index def6db1..0d56230 100644 --- a/app/components/TransfersGraph.jsx +++ b/app/components/TransfersGraph.jsx @@ -6,6 +6,7 @@ import { uniq, isNil } from 'ramda' import { toEther } from '../utils/conversions' import { getTokenLabel } from '../utils/currencies' import { FundingContext } from '../context' +import { getAuthorizations } from '../selectors/vault' Cytoscape.use(dagre) @@ -35,7 +36,6 @@ const stylesheet = [ } ] -const getAuthorizations = events => events.filter(event => event.event === 'AuthorizePayment') const createElements = (transfers, vaultEvents) => { if (isNil(transfers) || isNil(vaultEvents)) return [] const nodes = [] diff --git a/app/selectors/pledging.js b/app/selectors/pledging.js new file mode 100644 index 0000000..b0fb4b1 --- /dev/null +++ b/app/selectors/pledging.js @@ -0,0 +1,3 @@ +import { createSelector } from 'reselect' + +export const getDeposits = createSelector() diff --git a/app/selectors/vault.js b/app/selectors/vault.js new file mode 100644 index 0000000..cea74fe --- /dev/null +++ b/app/selectors/vault.js @@ -0,0 +1,6 @@ +import { createSelector } from 'reselect' + +export const getAuthorizations = createSelector( + [vaultEvents => vaultEvents.filter(event => event.event === 'AuthorizePayment')], + event => event +) diff --git a/package.json b/package.json index f8c8ba1..559611e 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "react-chartjs-2": "^2.7.4", "react-cytoscapejs": "^1.1.0", "react-dom": "^16.6.3", - "react-router-dom": "^4.3.1" + "react-router-dom": "^4.3.1", + "reselect": "^4.0.0" } } diff --git a/yarn.lock b/yarn.lock index da359dd..70e544d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6142,6 +6142,11 @@ require-uncached@^1.0.3: caller-path "^0.1.0" resolve-from "^1.0.0" +reselect@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.0.0.tgz#f2529830e5d3d0e021408b246a206ef4ea4437f7" + integrity sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA== + resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"