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
import { type StoreApi } from 'zustand'; | |
import { type NamedSet } from 'zustand/middleware'; | |
type FirstSetStateArg<T> = Parameters<StoreApi<T>['setState']>[0]; | |
export type SetState<T> = (partial: FirstSetStateArg<T>, name?: string) => void; | |
export type GetState<T> = StoreApi<T>['getState']; | |
type StateObject = Record<string, any>; | |
type SliceKey<S extends StateObject> = { |
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
import reloadOnUpdate from "virtual:reload-on-update-in-background-script"; | |
reloadOnUpdate("pages/background"); | |
import { | |
type Store, | |
type StoreApi, | |
type Dispatch, | |
type Listener, | |
} from '@lib/store'; |
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
import stream from 'stream'; | |
import { | |
S3Client, | |
CreateMultipartUploadCommand, | |
UploadPartCommand, | |
CreateMultipartUploadCommandOutput, | |
CompleteMultipartUploadCommand, | |
CompletedPart, | |
DeleteObjectCommand, |
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
import { | |
Id, | |
UUID, | |
Expand, | |
Require, | |
} from './types'; | |
import { | |
isUUID | |
} from './uuids'; |
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
const Editor = () => { | |
// ... | |
useTopBarContent( | |
<ValidationBar /> | |
); | |
return ( | |
// ... | |
); | |
}; |
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
declare global { | |
/** | |
extend this where needed | |
*/ | |
export interface Meta { | |
session?: string; | |
receipt?: UUID; | |
} | |
} |
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
import { types, actions } from './actions'; | |
import apolloClient from '../lib/apolloClient'; | |
const client = apolloClient(); | |
const apiQuery = store => next => action => { | |
next(action); | |
if (action.type.includes(types.API_QUERY)) { | |
client.query(action.payload) |
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
import { camelCase } from 'camel-case'; | |
export function createActions(actionTypes) { | |
const types = {}; | |
const actions = {}; | |
actionTypes.forEach(property => { | |
types[property.replace('/', '_')] = property; | |
actions[camelCase(property)] = x => ({ type: property, payload: x }); | |
}); |
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
import { isPlainObject, isArray, camelCase, snakeCase } from 'lodash'; | |
export function snakeKeys(object) { | |
return deepTransformKeys(object, snakeCase); | |
} | |
export function camelKeys(object) { | |
return deepTransformKeys(object, camelCase); | |
} |
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
'use strict'; | |
var React = require('react'), | |
I18N = require('react-intl'), | |
I18NStore = require('stores/i18n_store'), | |
_ = require('lodash'), | |
FormattedMessage = I18N.FormattedMessage; | |
export default _.assign({ | |
getDefaultProps: function() { | |
var path = this.displayName.split('.').map(_.snakeCase).join('.'); |
NewerOlder