// all examples in this section are taken from the product demo page on ampbyexample.com
https://ampbyexample.com/samples_templates/product_page/
`` tab content: https://codepen.io/cathyxz/pen/vReqdy
type ValidationResult<T, U> = Partial<{ [Key in keyof T]: U }>; | |
type Validation<T, U> = (input: T) => ValidationResult<T, U>; | |
const mergeAll = <T, U>( | |
results: ValidationResult<T, U>[] | |
): ValidationResult<T, U> => | |
results.reduce((acc, a) => Object.assign(acc, a), {}); | |
const validate = <T, U = boolean | string>( | |
validations: Validation<T, U>[] |
type State = { | |
added: boolean; | |
interval: false | ReturnType<typeof setInterval>; | |
inFrame: boolean; | |
callbacks: Array<SetFocusedCallback>; | |
}; | |
type EnrichedHTMLIFrameElement = HTMLIFrameElement & { ___onWindowFocusHandled: boolean }; | |
type SetFocusedCallback = (focused?: boolean) => void; |
// all examples in this section are taken from the product demo page on ampbyexample.com
https://ampbyexample.com/samples_templates/product_page/
`` tab content: https://codepen.io/cathyxz/pen/vReqdy
// | |
// MIT License | |
// | |
// Copyright (c) 2018 Ali Sharif | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |
import { options, render } from 'preact'; | |
import { ATTR_KEY } from 'preact/src/constants'; | |
/** | |
* Returns the input properties that were passed to an element when it was | |
* rendered. | |
* | |
* See `shallowRender` documentation for usage example. | |
*/ |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
My friend Michael Jackson turned off github issues on one of his smaller projects. It got me thinking...
Maintainers getting burned out is a problem. Not just for the users of a project but the mental health of the maintainer. It's a big deal for both parties. Consumers want great tools, maintainers want to create them, but maintainers don't want to be L1 tech support, that's why they
These are the Kickstarter Engineering and Data role definitions for both teams.