type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
private evaluateExpression(expression: string): string { return `node -e 'console.log((${expression})());'`; }
Raisess/i3bcks-gen
src/Parser.ts
TypeScript
FunctionDeclaration
export async function calculateMinInterval( { args: { layers }, data }: XYChartProps, getIntervalByColumn: DataPublicPluginStart['search']['aggs']['getDateMetaByDatatableColumn'] ) { const filteredLayers = getFilteredLayers(layers, data); if (filteredLayers.length === 0) return; const isTimeViz = data.dateRa...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
FunctionDeclaration
function getValueLabelsStyling(isHorizontal: boolean) { const VALUE_LABELS_MAX_FONTSIZE = 15; const VALUE_LABELS_MIN_FONTSIZE = 10; const VALUE_LABELS_VERTICAL_OFFSET = -10; const VALUE_LABELS_HORIZONTAL_OFFSET = 10; return { displayValue: { fontSize: { min: VALUE_LABELS_MIN_FONTSIZE, max: VALUE_L...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
FunctionDeclaration
function getIconForSeriesType(seriesType: SeriesType): IconType { return visualizationTypes.find((c) => c.id === seriesType)!.icon || 'empty'; }
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
FunctionDeclaration
export function XYChartReportable(props: XYChartRenderProps) { const [state, setState] = useState({ isReady: false, }); // It takes a cycle for the XY chart to render. This prevents // reporting from printing a blank chart placeholder. useEffect(() => { setState({ isReady: true }); }, [setState]);...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
FunctionDeclaration
export function XYChart({ data, args, formatFactory, timeZone, chartsThemeService, paletteService, minInterval, onClickValue, onSelectRange, renderMode, }: XYChartRenderProps) { const { legend, layers, fittingFunction, gridlinesVisibilitySettings, valueLabels } = args; const chartTheme = charts...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
FunctionDeclaration
function getFilteredLayers(layers: LayerArgs[], data: LensMultiTable) { return layers.filter(({ layerId, xAccessor, accessors, splitAccessor }) => { return !( !accessors.length || !data.tables[layerId] || data.tables[layerId].rows.length === 0 || (xAccessor && data.tables[layerId]...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
FunctionDeclaration
function assertNever(x: never): never { throw new Error('Unexpected series type: ' + x); }
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
({ id }) => id
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(l) => l.xScaleType === 'time'
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(column) => column.id === filteredLayers[0].xAccessor
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(dependencies: { formatFactory: Promise<FormatFactory>; chartsThemeService: ChartsPluginSetup['theme']; paletteService: PaletteRegistry; getIntervalByColumn: DataPublicPluginStart['search']['aggs']['getDateMetaByDatatableColumn']; timeZone: string; }): ExpressionRenderDefinition<XYChartProps> => ({ name: '...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
() => undefined
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
async ( domNode: Element, config: XYChartProps, handlers: ILensInterpreterRenderHandlers ) => { handlers.onDestroy(() => ReactDOM.unmountComponentAtNode(domNode)); const onClickValue = (data: LensFilterEvent['data']) => { handlers.event({ name: 'filter', data }); }; const onSelectRa...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
() => ReactDOM.unmountComponentAtNode(domNode)
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(data: LensFilterEvent['data']) => { handlers.event({ name: 'filter', data }); }
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(data: LensBrushEvent['data']) => { handlers.event({ name: 'brush', data }); }
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
() => handlers.done()
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(c) => c.id === seriesType
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
() => { setState({ isReady: true }); }
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
({ id }) => id === filteredLayers[0].xAccessor
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(value: unknown): string => xAxisColumn && layersAlreadyFormatted[xAxisColumn.id] ? (value as string) : xAxisFormatter.convert(value)
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(layer) => layer.accessors.length > 1
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(layer) => layer.splitAccessor
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(layer) => layer.seriesType.includes('bar')
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(l) => l.isHistogram
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
( axisSeries: Array<{ layer: string; accessor: string }>, groupId: string ) => { const yTitle = groupId === 'right' ? args.yRightTitle : args.yTitle; return ( yTitle || axisSeries .map( (series) => data.tables[series.layer].columns.find((column) => column.id ...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(series) => data.tables[series.layer].columns.find((column) => column.id === series.accessor)?.name
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(column) => column.id === series.accessor
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(name) => Boolean(name)
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(groupId: string) => { const style = { tickLabel: { visible: groupId === 'right' ? tickLabelsVisibilitySettings?.yRight : tickLabelsVisibilitySettings?.yLeft, }, axisTitle: { visible: groupId === 'right' ? axisTitlesVisibilit...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(layer) => !layer.seriesType.includes('stacked')
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
([[geometry, series]]) => { // for xyChart series is always XYChartSeriesIdentifier and geometry is always type of GeometryValue const xySeries = series as XYChartSeriesIdentifier; const xyGeometry = geometry as GeometryValue; const layer = filteredLayers.find((l) => xySeries.seriesKeys.some((ke...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(l) => xySeries.seriesKeys.some((key: string | number) => l.accessors.includes(key.toString()))
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(key: string | number) => l.accessors.includes(key.toString())
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(row) => { if (layer.xAccessor) { if (layersAlreadyFormatted[layer.xAccessor]) { // stringify the value to compare with the chart value return xAxisFormatter.convert(row[layer.xAccessor]) === xyGeometry.x; } return row[layer.xAccessor] === xyGeo...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(col) => col.id === layer.xAccessor
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(row) => layer.splitAccessor && row[layer.splitAccessor] === pointValue
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(col) => col.id === layer.splitAccessor
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(el) => el.id === layer.xAccessor
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(point) => ({ row: point.row, column: point.column, value: point.value, table, })
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
({ x }) => { if (!x) { return; } const [min, max] = x; if (!xAxisColumn || !isHistogramViz) { return; } const table = data.tables[filteredLayers[0].layerId]; const xAxisColumnIndex = table.columns.findIndex((el) => el.id === filteredLayers[0].xAccessor); const timeFieldNa...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(el) => el.id === filteredLayers[0].xAccessor
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(d) => safeXAccessorLabelRenderer(d.value)
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(axis) => ( <Axis key={axis.groupId}
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(layer, layerIndex) => layer.accessors.map((accessor, accessorIndex) => { const { splitAccessor, seriesType, accessors, xAccessor, layerId, columnToLabel, yScaleType, xScaleType, isHistogram, ...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(accessor, accessorIndex) => { const { splitAccessor, seriesType, accessors, xAccessor, layerId, columnToLabel, yScaleType, xScaleType, isHistogram, palette, } = layer; ...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(value: unknown): boolean => value != null && typeof value !== 'object'
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(row: DatatableRow) => { const newRow = { ...row }; for (const column of table.columns) { const record = newRow[column.id]; if (record && !isPrimitive(record)) { newRow[column.id] = formatFactory(column.meta.params).convert(record); ...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(alreadyFormatted: Record<string, boolean>, { id }) => { if (alreadyFormatted[id]) { return alreadyFormatted; } alreadyFormatted[id] = table.rows.some( (row, i) => row[id] !== tableConverted.rows[i][id] ); return alre...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(row, i) => row[id] !== tableConverted.rows[i][id]
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(row) => !(xAccessor && typeof row[xAccessor] === 'undefined') && !( splitAccessor && typeof row[splitAccessor] === 'undefined' && typeof row[accessor] === 'undefined' )
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(row) => { row.unifiedX = i18n.translate('xpack.lens.xyChart.emptyXLabel', { defaultMessage: '(empty)', }); }
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(axisConfiguration) => axisConfiguration.series.find((currentSeries) => currentSeries.accessor === accessor)
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(currentSeries) => currentSeries.accessor === accessor
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
({ yAccessor, seriesKeys }) => { const overwriteColor = getSeriesColor(layer, accessor); if (overwriteColor !== null) { return overwriteColor; } const colorAssignment = colorAssignments[palette.name]; const seriesLayers: SeriesLayer[...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(col) => col.id === splitAccessor
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(key: string | number, i) => { if ( i === 0 && splitHint && splitAccessor && !layersAlreadyFormatted[splitAccessor] ) { return formatFactory(splitHint).convert(key); ...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(d: unknown) => yAxis?.formatter?.convert(d) || ''
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
({ layerId, xAccessor, accessors, splitAccessor }) => { return !( !accessors.length || !data.tables[layerId] || data.tables[layerId].rows.length === 0 || (xAccessor && data.tables[layerId].rows.every((row) => typeof row[xAccessor] === 'undefined')) || // stacked percentage bar...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(row) => typeof row[xAccessor] === 'undefined'
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
ArrowFunction
(row) => typeof row[splitAccessor] === 'undefined'
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
InterfaceDeclaration
export interface XYChartProps { data: LensMultiTable; args: XYArgs; }
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
InterfaceDeclaration
export interface XYRender { type: 'render'; as: 'lens_xy_chart_renderer'; value: XYChartProps; }
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
TypeAliasDeclaration
type InferPropType<T> = T extends React.FunctionComponent<infer P> ? P : T;
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
TypeAliasDeclaration
type SeriesSpec = InferPropType<typeof LineSeries> & InferPropType<typeof BarSeries> & InferPropType<typeof AreaSeries>;
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
TypeAliasDeclaration
type XYChartRenderProps = XYChartProps & { chartsThemeService: ChartsPluginSetup['theme']; paletteService: PaletteRegistry; formatFactory: FormatFactory; timeZone: string; minInterval: number | undefined; onClickValue: (data: LensFilterEvent['data']) => void; onSelectRange: (data: LensBrushEvent['data'])...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
MethodDeclaration
fn(data: LensMultiTable, args: XYArgs) { return { type: 'render', as: 'lens_xy_chart_renderer', value: { data, args, }, }; }
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
MethodDeclaration
getYAxesTitles(axis
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
MethodDeclaration
getYAxesStyle(axis
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
MethodDeclaration
name(d) { const splitHint = table.columns.find((col) => col.id === splitAccessor)?.meta?.params; // For multiple y series, the name of the operation is used on each, either: // * Key - Y name // * Formatted value - Y name if (accessors.length > 1) ...
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
MethodDeclaration
getFitOptions(fittingFunction)
AlexanderWert/kibana
x-pack/plugins/lens/public/xy_visualization/expression.tsx
TypeScript
FunctionDeclaration
export default function CompanyDetails(props: CompanyDetailsProps) { const { label = '', namePrefix, requiredFields, visibility } = props; const { i18n } = useCoreContext(); const { handleChangeFor, triggerValidation, data, valid, errors, isValid } = useForm<CompanyDetailsSchema>({ schema: required...
Adyen/adyen-web
packages/lib/src/components/internal/CompanyDetails/CompanyDetails.tsx
TypeScript
ArrowFunction
(name: string): string => `${namePrefix ? `${namePrefix}.` : ''}${name}`
Adyen/adyen-web
packages/lib/src/components/internal/CompanyDetails/CompanyDetails.tsx
TypeScript
ArrowFunction
(mode: string): Function => (e: Event): void => { const { name } = e.target as HTMLInputElement; const key = name.split(`${namePrefix}.`).pop(); handleChangeFor(key, mode)(e); }
Adyen/adyen-web
packages/lib/src/components/internal/CompanyDetails/CompanyDetails.tsx
TypeScript
ArrowFunction
(e: Event): void => { const { name } = e.target as HTMLInputElement; const key = name.split(`${namePrefix}.`).pop(); handleChangeFor(key, mode)(e); }
Adyen/adyen-web
packages/lib/src/components/internal/CompanyDetails/CompanyDetails.tsx
TypeScript
ArrowFunction
() => { const formattedData = getFormattedData(data); props.onChange({ data: formattedData, valid, errors, isValid }); }
Adyen/adyen-web
packages/lib/src/components/internal/CompanyDetails/CompanyDetails.tsx
TypeScript
MethodDeclaration
renderFormField('text', { name: generateFieldName
Adyen/adyen-web
packages/lib/src/components/internal/CompanyDetails/CompanyDetails.tsx
TypeScript
ArrowFunction
() => { describe("with a new release", () => { beforeEach(() => { jest .spyOn(updateSelectors, "getShouldRenderUpdateAvailableLink") .mockReturnValue(true); }); afterEach(() => jest.clearAllMocks()); it("renders the 'Update available' link when an update is available", () => {...
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
() => { beforeEach(() => { jest .spyOn(updateSelectors, "getShouldRenderUpdateAvailableLink") .mockReturnValue(true); }); afterEach(() => jest.clearAllMocks()); it("renders the 'Update available' link when an update is available", () => { const { tree: { root } ...
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
() => { jest .spyOn(updateSelectors, "getShouldRenderUpdateAvailableLink") .mockReturnValue(true); }
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
() => jest.clearAllMocks()
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
() => { const { tree: { root } } = testRender(<AppVersionItem item={item} style={{}}
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
() => { const { queryByTestId, navigation } = renderWithProviders( <AppVersionItem item={item} style={{}}
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
() => updateLink?.props.onPress()
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
() => { mixpanelSpy = spy(analyticsUtils, "track"); const linkEvent = analyticsUtils.Event.ControlledUpdateDetailsViewedFromAccount; const { queryByTestId } = renderWithProviders( <AppVersionItem item={item} style={{}}
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
() => { beforeEach(() => { jest .spyOn(updateSelectors, "getShouldRenderUpdateAvailableLink") .mockReturnValue(false); }); afterEach(() => jest.clearAllMocks()); it("should return null if getShould RenderUpdateAvailableLink selector is false", () => { const { queryByLabelT...
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
() => { jest .spyOn(updateSelectors, "getShouldRenderUpdateAvailableLink") .mockReturnValue(false); }
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
() => { const { queryByLabelText } = renderWithProviders( <AppVersionItem item={item} style={{}}
ethanneff/MobileComponents
src/components/List/__tests__/AppVersionItem.spec.tsx
TypeScript
ArrowFunction
(props: WithExtractedCurrentUserProps) => !!props.currentUser
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
(props: WithStateProps<State> & WithCurrentUserProps) => async (post: Post) => { const { setState, currentUser } = props; // jw: if the current user is not the author, then there is nothing to do. if (currentUser.oid !== post.author.oid) { return; ...
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
async (post: Post) => { const { setState, currentUser } = props; // jw: if the current user is not the author, then there is nothing to do. if (currentUser.oid !== post.author.oid) { return; } setState(ss => ({ ...ss, postForDeletion: post })); ...
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
ss => ({ ...ss, postForDeletion: post })
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
(props: WithStateProps<State>) => async () => { const { setState } = props; setState(ss => ({ ...ss, postForDeletion: undefined })); }
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
async () => { const { setState } = props; setState(ss => ({ ...ss, postForDeletion: undefined })); }
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
ss => ({ ...ss, postForDeletion: undefined })
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
(props: HandleDeletePostProps) => async () => { const { deletePost, intl, onPostDeleted, setState, currentUser, state: { postForDeletion } } = props; // jw: if we do not have a post to delete, there is nothing to do. if (!postForDeletion) { return; } // j...
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
async () => { const { deletePost, intl, onPostDeleted, setState, currentUser, state: { postForDeletion } } = props; // jw: if we do not have a post to delete, there is nothing to do. if (!postForDeletion) { return; } // jw: if the current user is not the ...
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
ss => ({ ...ss, isDeletingPost: true })
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
ss => ({ ...ss, isDeletingPost: false, postForDeletion: undefined })
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript