Skip to content

Instantly share code, notes, and snippets.

@rip222
rip222 / signal-store.ts
Created April 18, 2025 15:15
Angular signal store
import { InjectionToken, Signal, signal } from '@angular/core';
export const signalStore = <T extends object>(
initialState: T,
opts: StoreOptions = {},
) => {
const store = signal(initialState);
const patch = (partial: Partial<T> | ((current: T) => T)) => {
if (typeof partial === 'function') {
@rip222
rip222 / webdev_online_resources.md
Created February 4, 2019 10:35 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)