redux-online-store-enhancer
Automatically detect if you are online or online, in a browser or on a native device.
Install
yarn add redux-online-store-enhancer
Browser Example
; const reducer = online: onlineReducer; const middleware = ;const store = ; // get from state directlyconst online = store; // reselectconst selectOffline = stateonline;
React Native Example
;; const reducer = online: onlineReducer; const middleware = ;const store = ; // get from state directlyconst online = store; // reselectconst selectOffline = stateonline;
Global app state now has a top level, online, attribute that will dynamically change as browser goes on and online.