reverse caching: pass API into middleware
This commit is contained in:
parent
8c2aa4d87c
commit
61a42cc7e4
@ -33,7 +33,7 @@ export default function (api, browserHistory) {
|
||||
const certifications = new CertificationsMiddleware();
|
||||
const routeMiddleware = routerMiddleware(browserHistory);
|
||||
const chain = new ChainMiddleware();
|
||||
const registry = new RegistryMiddleware();
|
||||
const registry = new RegistryMiddleware(api);
|
||||
|
||||
const middleware = [
|
||||
settings.toMiddleware(),
|
||||
@ -41,7 +41,7 @@ export default function (api, browserHistory) {
|
||||
errors.toMiddleware(),
|
||||
certifications.toMiddleware(),
|
||||
chain.toMiddleware(),
|
||||
registry.toMiddleware()
|
||||
registry
|
||||
];
|
||||
|
||||
return middleware.concat(status, routeMiddleware, thunk);
|
||||
|
@ -21,10 +21,7 @@ import registryABI from '~/contracts/abi/registry.json';
|
||||
|
||||
import { setReverse, startCachingReverses } from './actions';
|
||||
|
||||
export default class RegistryMiddleware {
|
||||
toMiddleware () {
|
||||
return (store) => {
|
||||
const api = Contracts.get()._api;
|
||||
export default (api) => (store) => {
|
||||
let contract, confirmedEvents, removedEvents, timeout, interval;
|
||||
|
||||
let addressesToCheck = {};
|
||||
@ -105,6 +102,4 @@ export default class RegistryMiddleware {
|
||||
next(action);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user