You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an API watcher that handles updating parts of the state dynamically, enabling a central store for external content updates.
The initial idea is something similar to the following:
// Inside redux state tree
watch: [{url: '/api/4chan/g',// API url to monitorinterval: 10,// seconds to pause fortype: BOARD_UPDATED,// Action to use when a url returns a 200 HTTP response codelastRequestAt: 140374197,// unix timestampexpireOnError: true// Remove this object when a bad status code occurs, excluding 304s},{/* And so on... */}]
The type key is used as the dynamic action type when an item is updated.
This allows for a single service to:
Loop over the watch items,
Select any that are due to be checked,
Check them by requesting the API url
If a 200 http code is returned, use the type to broadcast the response to a particular node of the redux state.
This can be efficiently implemented inside a React container that enables/disables itself when there are/aren't any items to watch.
IDEA: Add an optional normalizr schema in each object to convert the response data before dispatching it.
The text was updated successfully, but these errors were encountered:
Create an API watcher that handles updating parts of the state dynamically, enabling a central store for external content updates.
The initial idea is something similar to the following:
The
type
key is used as the dynamic action type when an item is updated.This allows for a single service to:
type
to broadcast the response to a particular node of the redux state.This can be efficiently implemented inside a React container that enables/disables itself when there are/aren't any items to watch.
IDEA: Add an optional normalizr schema in each object to convert the response data before dispatching it.
The text was updated successfully, but these errors were encountered: