Let's examine the type for Entity
.
export interface Model {};
export type Entity<
TModels extends Model[],
> = {
id?: string,
creatorId?: string,
createTimeMs?: number,
gitf () | |
{ | |
prefix="dev/$USER/" | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
if [[ "$branch" = $prefix* ]]; then | |
echo "[INFO]: Force pushing to branch '$branch'..." | |
git push origin ":$branch" ; git push origin -u "$branch" | |
else | |
echo "[INFO]: Cannot push to branch '$branch' because it does not match prefix '$prefix'." | |
} |
/** private type, not exported */ | |
declare type NonObject = undefined | null | boolean | string | number | Function; | |
/** | |
* This type allows you to mark an object with | |
* optional properties as required. | |
*/ | |
export declare type Complete<T> = { | |
[K in keyof T]-?: T[K]; | |
} | |
/** |
Let's examine the type for Entity
.
export interface Model {};
export type Entity<
TModels extends Model[],
> = {
id?: string,
creatorId?: string,
createTimeMs?: number,
import { NonObject } from "./core-types"; | |
export type DeepComplete<T> = T extends NonObject | |
? Exclude<T, undefined> | |
: T extends Array<infer U> | |
? DeepCompleteArray<U> | |
: T extends Map<infer K, infer V> | |
? DeepCompleteMap<K, V> | |
: DeepCompleteObject<T>; |
// Within SPA webapp | |
import { useEffect } from 'react'; | |
export default function() { | |
useEffect(() => { | |
window.addEventListener('keydown', (event) => { | |
if ((event.ctrlKey || event.metaKey) && event.code === "KeyC") { | |
document.execCommand("copy"); | |
} else if ((event.ctrlKey || event.metaKey) && event.code === "KeyX") { | |
document.execCommand("cut"); |
import { useState, useEffect, useCallback } from 'react'; | |
const getSize = () => { | |
return { | |
width: window.innerWidth, | |
height: window.innerHeight, | |
}; | |
}; | |
export function useResize() { |
function hashString(s) { | |
let hashValue = 0; | |
for (let i = 0; i < s.length; i++) { | |
hashValue = (hashValue * 31 + s.charCodeAt(i)) % 4294967296; | |
} | |
let bucket = Math.floor((hashValue / 4294967296) * 8); | |
return bucket; | |
} | |
@prmichaelsen/parm@2.0.0 /Users/patrick/workplace/parm-v1.0.0 | |
├─┬ @angular/forms@14.1.2 | |
│ ├─┬ @angular/common@14.1.2 | |
│ │ ├── @angular/core@14.1.2 deduped | |
│ │ ├── rxjs@7.5.6 deduped | |
│ │ └── tslib@2.4.0 deduped | |
│ ├─┬ @angular/core@14.1.2 | |
│ │ ├── rxjs@7.5.6 deduped | |
│ │ ├── tslib@2.4.0 deduped | |
│ │ └─┬ zone.js@0.11.8 |
import React, { | |
useEffect, useRef, | |
useState, useCallback, | |
} from 'react'; | |
export function useResize() { | |
const getSize = () => { | |
return { | |
width: window.innerWidth, | |
height: window.innerHeight |