export interface QueryCodec<T> {
parse: (raw: string | null) => T;
serialize: (value: T) => string | null;
}
export function stringParam(fallback = ""): QueryCodec<string> {
import { Injectable } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@Injectable()
export class SignupFormService {
readonly form: FormGroup;
import { createContext } from 'react';
export type ToastVariant = 'success' | 'error' | 'info';
export interface Toast {
id: number;
import React, { createContext, useContext, useReducer, useState } from 'react';
// 1. Basic Context
const UserContext = createContext(null);
function UserProvider({ children }) {
import { useState, useEffect, useCallback } from 'react';
export function useLocalStorage(key, initialValue) {
const readValue = useCallback(() => {
if (typeof window === 'undefined') return initialValue;
try {
require 'sinatra/base'
require_relative 'cart'
require_relative 'cart_helpers'
class StoreApp < Sinatra::Base
enable :sessions
export interface CartItem {
id: string;
name: string;
price: number;
quantity: number;
}