useReducer is useState’s more powerful sibling. When state logic gets complex, useReducer brings predictability. Basic Usage With Context Combine useReducer with Context for app-wide state management – a simpler alternative to Redux: When to Use useReducer Multiple related state updates Next state depends on previous state Complex state objects Want Redux-like patterns without Redux
Read more โMediator Pattern in C#: Implementing with MediatR
MediatR implements the mediator pattern in .NET, decoupling request handling from the caller. It’s become my go-to for organizing application logic. Setup Request and Handler Using in Controller Benefits Decoupled handlers – easy to test Pipeline behaviors for cross-cutting concerns Clean controller actions References MediatR GitHub
Read more โMicrosoft Graph API: Working with Users and Groups
Graph API gives you access to Azure AD users and groups. Here are common operations you’ll need. Get Current User List Users Get User’s Groups Permissions Needed User.Read – Read own profile User.Read.All – Read all users GroupMember.Read.All – Read group memberships References Graph Users API
Read more โContext Distillation Methods: Extracting Signal from Long Documents
Introduction: Long contexts contain valuable information, but they also contain noise, redundancy, and irrelevant details that consume tokens and dilute model attention. Context distillation extracts the essential information from lengthy documents, conversations, or retrieved passages, producing compact representations that preserve what matters while discarding what doesn’t. This technique is crucial for RAG systems processing multiple […]
Read more โTypeScript Generics: Writing Flexible, Reusable Code
Generics let you write functions and classes that work with any type while maintaining type safety. They’re essential for reusable TypeScript code. Basic Generic Function Generic Interfaces Constraints References TypeScript Generics
Read more โVue.js Computed Properties and Watchers
Computed properties and watchers are powerful Vue.js features. Understanding when to use each is key to writing clean Vue code. Computed Properties Computed properties are cached and only update when dependencies change: Watchers Watchers react to changes – good for side effects: When to Use Which Computed: Deriving values, templates, getters Watch: Side effects, async […]
Read more โ