How to use the react-relay-offline/lib/runtime/EnvironmentIDB.create function in react-relay-offline

To help you get started, we’ve selected a few react-relay-offline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github morrys / offline-examples / todo / js / app.js View on Github external
}),
  });

  return response.json();
}



import RelayNetworkLogger from 'relay-runtime/lib/RelayNetworkLogger'
const network = Network.create(RelayNetworkLogger.wrapFetch(fetchQuery, () => ''));
function callbackOffline(type, payload, error) {
  //console.log("callbackoffline", type)
  //console.log("callbackoffline", payload)
  //console.log("callbackoffline", error)
}
const modernEnvironment = EnvironmentIDB.create({ network }, callbackOffline);
const rootElement = document.getElementById('root');

if (rootElement) {
  ReactDOM.render(