What are actions?
Immutability
Example Action
// actions.ts
import { State } from './state';
export function addFramework(currentState: State, newFramework: string): State {
return {
...currentState, // Copy the existing state
frameworks: [...currentState.frameworks, newFramework] // Create a new array with the added framework
};
}Registering Actions
Unregistering Actions
Last updated
Was this helpful?