Skip to content

Instantly share code, notes, and snippets.

import { Authorizer } from '@authorizerdev/authorizer-js';
import { createContext, createEffect, createMemo, onCleanup, useContext } from 'solid-js';
import type { ParentComponent } from 'solid-js';
import { createStore } from 'solid-js/store';
import type { User, AuthToken } from '@authorizerdev/authorizer-js';
import type { Context, AuthorizerState } from '@/types';
const AuthorizerContext = createContext<Context>([
{
@alveshelio
alveshelio / tailwind-css-color-palette.ts
Last active October 17, 2022 00:22
Tailwind CSS 3.1 Color Palette
// https://tailwindcss.com/docs/customizing-colors#default-color-palette
const colors = {
slate: {
50: '#f8fafc',
100: '#f1f5f9',
200: '#e2e8f0',
300: '#cbd5e1',
400: '#94a3b8',
500: '#64748b',
@alveshelio
alveshelio / machine.js
Last active November 29, 2020 18:34
Generated by XState Viz: https://xstate.js.org/viz
const lit = {
on: {
BREAK: 'broken',
TOGGLE: 'unlit',
CHNAGE_COLOR: {
actions: ['changeColor']
}
}
}
const unlit = {
@alveshelio
alveshelio / machine.js
Last active November 29, 2020 18:05
Generated by XState Viz: https://xstate.js.org/viz
const lit = {
on: {
BREAK: {
target: 'broken',
actions: () => console.warn('transition to onBreak')
},
TOGGLE: 'unlit',
},
exit: () => console.warn("it's dark and cold")