MCPcopy Create free account
hub / github.com/react-static/react-static / run

Function run

packages/react-static/src/browser/index.js:122–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

120 if (process.env.REACT_STATIC_ENV === 'development') {
121 const io = require('socket.io-client')
122 const run = async () => {
123 try {
124 const socket = io()
125 socket.on('connect', () => {
126 // Do nothing
127 })
128 socket.on('message', ({ type }) => {
129 if (type === 'reloadClientData') {
130 reloadClientData()
131 }
132 })
133 } catch (err) {
134 console.log(
135 'React-Static data hot-loader websocket encountered the following error:'
136 )
137 console.error(err)
138 }
139 }
140 run()
141 }
142

Callers 1

initFunction · 0.85

Calls 3

onVisibleFunction · 0.85
prefetchFunction · 0.85
reloadClientDataFunction · 0.70

Tested by

no test coverage detected