This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vertexes = "user" | "user.address" | "user.address.state" | "user.address.city" | "user.phone" | |
type Vertexes = VertexesOfTree<{ | |
user: { | |
address: { | |
state: string, | |
city: string | |
}, | |
phone: number | |
} }> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type V = string | symbol | number; | |
export type InverseKeyValue<T extends { [K in V]: V }> = T extends { [K in infer A]: infer B } | |
? B extends V | |
? { [K in B]: A } | |
: never | |
: never; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.register('./sw.js') // Path to sw file | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Example using caching */ | |
import { ExpirationPlugin } from 'workbox-expiration'; | |
import { precacheAndRoute } from 'workbox-precaching'; | |
import { registerRoute } from 'workbox-routing'; | |
import { StaleWhileRevalidate } from 'workbox-strategies'; | |
// Inject workbox in Service Worker | |
precacheAndRoute(self.__WB_MANIFEST); | |
// Enable navigation preload (work in Chrome) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Proposed type of component | |
*/ | |
// Simple | |
@connectToModel({ instanceName, configCreator }) | |
class StatementTabs extends React.Component { | |
render() { | |
const { config } = this.state; | |
const { theme } = this.props; |