: resolveFrom(path.resolve('node_modules'), 'react-dom'),\n },\n }\n return config\n}\n\nconst includeSrcDirectory = config =\u003E {\n config.resolve = {\n ...config.resolve,\n modules: [path.resolve('src'), ...config.resolve.modules],\n }\n return config\n}\n\nmodule.exports = [\n ['use-babel-config', '.babelrc'],\n ['use-eslint-config', '.eslintrc'],\n fixLinkedDependencies,\n \u002F\u002F includeSrcDirectory,\n]\n","directory_shortid":null,"id":"bca6fcea-7c49-4bb8-bbe9-d9184c1a86d3","inserted_at":"2020-11-03T07:55:54","is_binary":false,"sha":null,"shortid":"B1B5mU3TdD","source_id":"14126a69-12c1-4edb-a7c5-5ac3b4f83bd5","title":".rescriptsrc.js","updated_at":"2020-11-02T16:38:57","upload_id":null},{"code":"{}\n","directory_shortid":null,"id":"b143128b-30f7-4352-bf5f-02e27dbe5117","inserted_at":"2020-11-03T07:55:54","is_binary":false,"sha":null,"shortid":"SkVqm836uD","source_id":"14126a69-12c1-4edb-a7c5-5ac3b4f83bd5","title":".prettierrc","updated_at":"2020-11-02T16:38:57","upload_id":null},{"code":"# See https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fignoring-files\u002F for more about ignoring files.\n\n# dependencies\n\u002Fnode_modules\n\u002F.pnp\n.pnp.js\n\n# testing\n\u002Fcoverage\n\n# production\n\u002Fbuild\n\nyarn.lock\npackage-lock.json\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n","directory_shortid":null,"id":"cc3bc096-f802-48eb-a1bb-aa4f796ceb74","inserted_at":"2020-11-03T07:55:54","is_binary":false,"sha":null,"shortid":"SkmqQLnpdw","source_id":"14126a69-12c1-4edb-a7c5-5ac3b4f83bd5","title":".gitignore","updated_at":"2020-11-02T16:38:57","upload_id":null},{"code":"{\n \"extends\": [\"react-app\", \"prettier\"],\n \"rules\": {\n \u002F\u002F \"eqeqeq\": 0,\n \u002F\u002F \"jsx-a11y\u002Fanchor-is-valid\": 0\n }\n}\n","directory_shortid":null,"id":"3ef2e358-7eb4-4e01-bc42-d39a74de2fdb","inserted_at":"2020-11-03T07:55:54","is_binary":false,"sha":null,"shortid":"B1Mq7L2pdD","source_id":"14126a69-12c1-4edb-a7c5-5ac3b4f83bd5","title":".eslintrc","updated_at":"2020-11-02T16:38:57","upload_id":null},{"code":"import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useQuery, QueryCache, ReactQueryCacheProvider } from \"react-query\";\nimport { ReactQueryDevtools } from \"react-query-devtools\";\n\nconst queryCache = new QueryCache();\n\nexport default function App() {\n return (\n \u003CReactQueryCacheProvider queryCache={queryCache}\u003E\n \u003CExample \u002F\u003E\n \u003C\u002FReactQueryCacheProvider\u003E\n );\n}\n\nfunction Example() {\n const [isOpen, setIsOpen] = React.useState(false);\n\n return (\n \u003Cdiv\u003E\n \u003Cul\u003E\n \u003Cli\u003EOpen the Modal\u003C\u002Fli\u003E\n \u003Cli\u003E\n It will load a random number and show it, but not put it to state\n \u003C\u002Fli\u003E\n \u003Cli\u003ERe-focus the window - the value will still update\u003C\u002Fli\u003E\n \u003Cli\u003E\n Change the value: Your draft now takes precedence and the query is\n disabled\n \u003C\u002Fli\u003E\n \u003Cli\u003E\n Close the modal and open it again: No loading spinner, value will\n update\n \u003C\u002Fli\u003E\n \u003C\u002Ful\u003E\n \u003Cbutton type=\"button\" onClick={() =\u003E setIsOpen(true)}\u003E\n Open\n \u003C\u002Fbutton\u003E\n {isOpen && \u003CModal close={() =\u003E setIsOpen(false)} \u002F\u003E}\n \u003CReactQueryDevtools\n initialIsOpen\n panelProps={{ style: { height: 250 } }}\n \u002F\u003E\n \u003C\u002Fdiv\u003E\n );\n}\n\nconst sleep = (time) =\u003E new Promise((resolve) =\u003E setTimeout(resolve, time));\n\nconst useRandomValue = () =\u003E {\n const [draft, setDraft] = React.useState(undefined);\n const { data, ...queryInfo } = useQuery(\n \"random\",\n async () =\u003E {\n await sleep(1000);\n return Promise.resolve(String(Math.random()));\n },\n {\n enabled: !draft\n }\n );\n\n return {\n value: draft ?? data,\n setDraft,\n queryInfo\n };\n};\n\nfunction Modal({ close }) {\n const {\n value,\n setDraft,\n queryInfo: { isLoading, error }\n } = useRandomValue();\n\n return (\n \u003Cdiv\n style={{\n position: \"fixed\",\n top: \"0\",\n left: \"0\",\n paddingTop: \"10px\",\n width: \"100%\",\n height: \"100%\",\n backgroundColor: \"rgba(0,0,0,0.4)\"\n }}\n \u003E\n \u003Cdiv\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n width: \"80%\",\n height: \"25vh\",\n margin: \"auto\",\n backgroundColor: \"white\"\n }}\n \u003E\n \u003Cdiv\u003E\n {isLoading && \"Loading...\"}\n {error && \"error\"}\n {value !== undefined && (\n \u003Cinput\n type=\"text\"\n value={value}\n onChange={(event) =\u003E setDraft(event.target.value)}\n \u002F\u003E\n )}\n \u003Cspan style={{ cursor: \"pointer\" }} onClick={close}\u003E\n ×\n \u003C\u002Fspan\u003E\n \u003C\u002Fdiv\u003E\n \u003C\u002Fdiv\u003E\n \u003C\u002Fdiv\u003E\n );\n}\n\nconst rootElement = document.getElementById(\"root\");\nReactDOM.render(\u003CApp \u002F\u003E, rootElement);\n","directory_shortid":"Hke5QIhTdw","id":"3865c00b-2f23-4770-983e-987af1ed011e","inserted_at":"2020-11-03T07:55:54","is_binary":false,"sha":null,"shortid":"By9c78hTdD","source_id":"14126a69-12c1-4edb-a7c5-5ac3b4f83bd5","title":"index.js","updated_at":"2020-11-16T16:00:00","upload_id":null},{"code":"{\n \"private\": true,\n \"scripts\": {\n \"start\": \"rescripts start\",\n \"build\": \"rescripts build\",\n \"test\": \"rescripts test\",\n \"eject\": \"rescripts eject\"\n },\n \"dependencies\": {\n \"react\": \"^16.8.6\",\n \"react-dom\": \"^16.8.6\",\n \"react-query\": \"2.26.2\",\n \"react-query-devtools\": \"2.6.3\",\n \"react-scripts\": \"3.0.1\"\n },\n \"devDependencies\": {\n \"@rescripts\u002Fcli\": \"^0.0.11\",\n \"@rescripts\u002Frescript-use-babel-config\": \"^0.0.8\",\n \"@rescripts\u002Frescript-use-eslint-config\": \"^0.0.9\",\n \"babel-eslint\": \"10.0.1\"\n },\n \"browserslist\": {\n \"production\": [\n \"\u003E0.2%\",\n \"not dead\",\n \"not op_mini all\"\n ],\n \"development\": [\n \"last 1 chrome version\",\n \"last 1 firefox version\",\n \"last 1 safari version\"\n ]\n },\n \"keywords\": [],\n \"name\": \"separate-server-and-client-state\",\n \"description\": \"\"\n}","directory_shortid":null,"id":"f994ea89-c497-4558-9614-2722c74ae733","inserted_at":"2020-11-03T07:55:54","is_binary":false,"sha":null,"shortid":"HkP9XUn6dD","source_id":"14126a69-12c1-4edb-a7c5-5ac3b4f83bd5","title":"package.json","updated_at":"2020-11-16T16:08:43","upload_id":null}],"original_git":null,"picks":[],"tags":[],"updated_at":"2020-11-16T16:08:43","privacy":0,"npm_dependencies":{},"original_git_commit_sha":"5d56cf5c28f3e8a55183d45e31d3e5bc88a36f57","room_id":null,"author":{"avatar_url":"https:\u002F\u002Favatars2.githubusercontent.com\u002Fu\u002F1021430?v=4","id":"2edeaf74-8e7e-407f-9b27-7baf599cdd6b","name":"Dominik Dorfmeister","personal_workspace_id":"f8b1f196-24ca-4cb8-91fa-60c35640afe6","subscription_plan":null,"subscription_since":null,"username":"TkDodo"},"version":44,"always_on":false};