score:3
I've had a similar situation before. I have a front end which connects via web sockets to the API. The API emits a message on successful database commit with the API endpoint matching the update. The front end components listen for these update socket messages and if the updated type is relevant to that component the component will query the API endpoint over https for the new data. Using a web socket only to advertise that an update is available won't necessitate rewriting the entire API.
Source: stackoverflow.com
Related Query
- Correct way to update frontend when backend changes
- Correct way to use useEffect() to update when data changes
- React: why child component doesn't update when prop changes
- Correct way to type nullable state when using React's useState hook
- TS2322 Error when extending Button, component property not found. What is the correct way to type?
- npm concurrently error? when running both frontend and backend together?
- Update React Data when MySQL Data Changes
- Simple way to update form values depending on changes with react-final-form
- How to update specific form field in formik when value changes in redux store?
- Getting error "Cannot update a component while rendering a different component". What is the correct way to achieve what I'm attempting?
- How to instantly update state when any changes into the localStorage in React.js
- Update UI when useRef Div Width Changes
- What is the best way to update my react state when data in database changes?
- AgGridReact - Grid does not update when isRowSelectable changes
- Correct way to update an objects state in react (Merged state? Spread operators?)
- The correct way to update props with Mapbox
- Update another component when Formik form changes
- Correct way to fetch data when switching route on same level in react-router?
- Update component when the store changes
- React state created with useState doesn't update automatically when my API changes
- Reactjs frontend gets error when backend runs
- React class does not update when state changes
- Update state when imported variable changes using react hooks
- Reach child does not update when state changes
- How would one do two way data binding with react, having an input value A update when B is, and vice versa?
- React update useState() when variable value changes
- Correct way to write in dependency array when dispatch an action using hooks in redux
- Better way to execute useEffect when boolean changes in one direction?
- What is the correct way to initiate a side-effect on page load when using React Strict Mode?
- Correct way of connecting Websocket events to update my React Component
More Query from same tag
- Passing props from a parent component to a child component in react
- ReactJS event.target.value returns as undefined
- React app detect if user refresh window or navigated away
- How to fetch data URL
- how to hide or show a div if checkbox is selected in React JS
- react js lodash loop thru and change a field value
- In my React app I can't figure out how to pass the value of an input box to a button's onclick
- How to mock the formik useFormikContext hook when writing unit tests with jest
- Can't render a togglable component in Jest/Enzyme
- Change detection with react
- get state from redux react component in jest unit test
- Upload files with React Hooks and Ant Design
- How to change the value of 1 select if there are a lot of them on the page
- ReactJS: Unable to grab data from a function
- React components conditional rendering
- Set state based on value of array item in previous state
- Override styles in Fab button is not working
- Select option with React TestUtils Simulate
- Chartjs: I only want left and right padding in pie chart
- Import methods without using relative path syntax
- React-admin TypeError: dynamicSheet.update(...) is undefined
- Turn for loop of Axios post requests to promise
- How to extract and play animation in react-three-fiber
- Disable link based on input values: ReactJS
- How to redirect to 404 page if data is invalid in getStaticProps?
- How to use switch cases inside JSX: ReactJS
- How to change the background color of the input in NextUI
- What is the expected return of `useEffect` used for?
- "core:propertyTypes:warn "#bot" asset not found. " - aframe-master.js
- Using context.drawImage() with a MediaStream