DEV Community

Shashank Trivedi
Shashank Trivedi

Posted on

2

Philosophy of Redux

Redux is a state management library that follows a few core principles and philosophies:

Single Source of Truth:

1. In Redux, the entire application state is stored in a single object tree inside a single store. This ensures that all data is centralized, making debugging, testing, and managing the application easier.

2. This "single source of truth" also makes the application state predictable, as any state change happens through explicit actions.

State is Read-Only:
The only way to change the state in Redux is by dispatching actions. Actions are plain objects that describe "what happened" but do not directly mutate the state. The reducers, which are pure functions, handle these actions and return a new state based on the action's type and payload.

Changes are Made with Pure Functions:

  • Reducers are pure functions that take the current state and an action and return a new state. They must be predictable, without side effects, and always produce the same output given the same input.

  • This makes state transitions more predictable and easier to reason about.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay