Skip to main content

Posts

Showing posts from April, 2018

TypeError: Undefined: Redux 4

Redux 4 > createStore > compose The ErrorTypeError: Cannot read property 'apply' of undefined [node_modules/redux/es/redux.js:523] The Problem and Solution If you've gone through a tutorial in which they suggest adding the Redux Dev Tools in your store.js like this:

window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() But they're using it inside of a compose(), you could receive a Type Error for an undefined when the extension is not enabled (or present). The correct way to implement the Redux Dev Tools within a compose is as follows:

window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose I learned this the hard way, and was eventually brought rescue from GitHub user [zalmoxisus]. zalmoxisus also references the docs for this: [1.2 Advanced store setup (middleware and enhancers)] Code Extract from [store.js] compose( applyMiddleware(...middleware), window.__REDUX_DEVTOOLS_EXTENSION__ &…

Expired To Be: Now Available Most Anywhere

As a gift to the month of April, Expired To Be is now accessible from any browser! :)
What is... 'Expired To Be' is an app where you can set reminders for 'things that expire'. Initially only available from the Chrome web store as a Chrome browser extension, it can now be accessed from any browser. The new SPA version of the app is hosted on GitHub Pages (and built via Travis CI).

Both apps share the same source code, which is all open source on GitHub.

A Special Treat
The one and only; SPA Integration Diagram: This diagram details the layout and integration between my custom React 'Alarms API' and the Chrome extension core files.

SPA Alarm Notifications
The Expired To Be 'SPA version' provides a few options for 'expiration notifications' (although unfortunately some platforms still don't support web-based notifications; in which case it'll fall back to using the default, which is `alert()`). Modals are the other option, but are more passiv…