Typechecking state transitions in a React/Redux app
javiercasas.com
javiercasas.com
const App : React.FunctionComponent = () => {
const { loading, data, error } = useMagicFetch(...);
if (error) return <Error error={error} />;
if (loading) return <Loader />;
return <DataList data={data} />;
}
But then you lose the benefits of serializable / replayable / shared state. Mind you, I've built multiple apps that ended up not too far from this, and am eagerly looking for alternatives.I’d be curious what your thoughts are on (off-topic) using something like InversifyJS to accomplish IOC/DI in Typescript? I accidentally went down that rabbit-hole this week before realizing maybe the only thing I’m good at is creating a damn awful mess with overcomplicated frameworks and design patterns.
The learning curve took me a while, but now creating new objects and inserting them into my app doesn't require too much thinking and is nearly bug free