type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
FunctionDeclaration |
export function run(ctx: Ctx): Cmd {
let prevRunnable: RunnableQuickPick | undefined;
return async () => {
const editor = ctx.activeRustEditor;
const client = ctx.client;
if (!editor || !client) return;
const textDocument: lc.TextDocumentIdentifier = {
uri: editor.... | 71/rust-analyzer | editors/code/src/commands/runnables.ts | TypeScript |
FunctionDeclaration |
export function runSingle(ctx: Ctx): Cmd {
return async (runnable: Runnable) => {
const editor = ctx.activeRustEditor;
if (!editor) return;
const task = createTask(runnable);
task.group = vscode.TaskGroup.Build;
task.presentationOptions = {
reveal: vscode.TaskRe... | 71/rust-analyzer | editors/code/src/commands/runnables.ts | TypeScript |
FunctionDeclaration |
function createTask(spec: Runnable): vscode.Task {
const TASK_SOURCE = 'Rust';
const definition: CargoTaskDefinition = {
type: 'cargo',
label: spec.label,
command: spec.bin,
args: spec.args,
env: spec.env,
};
const execOption: vscode.ShellExecutionOptions = {
... | 71/rust-analyzer | editors/code/src/commands/runnables.ts | TypeScript |
ArrowFunction |
async () => {
const editor = ctx.activeRustEditor;
const client = ctx.client;
if (!editor || !client) return;
const textDocument: lc.TextDocumentIdentifier = {
uri: editor.document.uri.toString(),
};
const params: RunnablesParams = {
textDocument... | 71/rust-analyzer | editors/code/src/commands/runnables.ts | TypeScript |
ArrowFunction |
async (runnable: Runnable) => {
const editor = ctx.activeRustEditor;
if (!editor) return;
const task = createTask(runnable);
task.group = vscode.TaskGroup.Build;
task.presentationOptions = {
reveal: vscode.TaskRevealKind.Always,
panel: vscode.TaskPanelKi... | 71/rust-analyzer | editors/code/src/commands/runnables.ts | TypeScript |
ClassDeclaration |
class RunnableQuickPick implements vscode.QuickPickItem {
public label: string;
public description?: string | undefined;
public detail?: string | undefined;
public picked?: boolean | undefined;
constructor(public runnable: Runnable) {
this.label = runnable.label;
}
} | 71/rust-analyzer | editors/code/src/commands/runnables.ts | TypeScript |
InterfaceDeclaration |
interface RunnablesParams {
textDocument: lc.TextDocumentIdentifier;
position?: lc.Position;
} | 71/rust-analyzer | editors/code/src/commands/runnables.ts | TypeScript |
InterfaceDeclaration |
interface Runnable {
label: string;
bin: string;
args: string[];
env: { [index: string]: string };
cwd?: string;
} | 71/rust-analyzer | editors/code/src/commands/runnables.ts | TypeScript |
InterfaceDeclaration |
interface CargoTaskDefinition extends vscode.TaskDefinition {
type: 'cargo';
label: string;
command: string;
args: string[];
env?: { [key: string]: string };
} | 71/rust-analyzer | editors/code/src/commands/runnables.ts | TypeScript |
FunctionDeclaration |
export default function confirm(config: ModalFuncProps): {
destroy: (...args: any[]) => void;
update: (newConfig: ModalFuncProps) => void;
}; | Atulkr/Assignment | node_modules/antd/es/modal/confirm.d.ts | TypeScript |
FunctionDeclaration |
export declare function withWarn(props: ModalFuncProps): ModalFuncProps; | Atulkr/Assignment | node_modules/antd/es/modal/confirm.d.ts | TypeScript |
FunctionDeclaration |
export declare function withInfo(props: ModalFuncProps): ModalFuncProps; | Atulkr/Assignment | node_modules/antd/es/modal/confirm.d.ts | TypeScript |
FunctionDeclaration |
export declare function withSuccess(props: ModalFuncProps): ModalFuncProps; | Atulkr/Assignment | node_modules/antd/es/modal/confirm.d.ts | TypeScript |
FunctionDeclaration |
export declare function withError(props: ModalFuncProps): ModalFuncProps; | Atulkr/Assignment | node_modules/antd/es/modal/confirm.d.ts | TypeScript |
FunctionDeclaration |
export declare function withConfirm(props: ModalFuncProps): ModalFuncProps; | Atulkr/Assignment | node_modules/antd/es/modal/confirm.d.ts | TypeScript |
InterfaceDeclaration |
export interface ModalStaticFunctions {
info: ModalFunc;
success: ModalFunc;
error: ModalFunc;
warn: ModalFunc;
warning: ModalFunc;
confirm: ModalFunc;
} | Atulkr/Assignment | node_modules/antd/es/modal/confirm.d.ts | TypeScript |
TypeAliasDeclaration |
export declare type ModalFunc = (props: ModalFuncProps) => {
destroy: () => void;
update: (newConfig: ModalFuncProps) => void;
}; | Atulkr/Assignment | node_modules/antd/es/modal/confirm.d.ts | TypeScript |
ArrowFunction |
() => this.remove(callback, context) | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
ArrowFunction |
(listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]) => {
if (!this._callbacks) {
this._callbacks = new CallbackList();
}
if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {
this._... | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
ArrowFunction |
() => {
this._callbacks!.remove(listener, thisArgs);
result.dispose = Emitter._noop;
if (this._options && this._options.onLastListenerRemove && this._callbacks!.isEmpty()) {
this._options.onLastListenerRemove(this);
... | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
ClassDeclaration |
class CallbackList {
private _callbacks: Function[] | undefined;
private _contexts: any[] | undefined;
public add(callback: Function, context: any = null, bucket?: Disposable[]): void {
if (!this._callbacks) {
this._callbacks = [];
this._contexts = [];
}
th... | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
ClassDeclaration |
export class Emitter<T> {
private static _noop = function () { };
private _event: Event<T>;
private _callbacks: CallbackList | undefined;
constructor(private _options?: EmitterOptions) {
}
/**
* For the public to allow to subscribe
* to events from this Emitter
*/
get eve... | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
InterfaceDeclaration | /**
* Represents a typed event.
*/
export interface Event<T> {
/**
*
* @param listener The listener function will be call when the event happens.
* @param thisArgs The 'this' which will be used when calling the event listener.
* @param disposables An array to which a {{IDisposable}} will be a... | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
InterfaceDeclaration |
export interface EmitterOptions {
onFirstListenerAdd?: Function;
onLastListenerRemove?: Function;
} | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
MethodDeclaration |
public add(callback: Function, context: any = null, bucket?: Disposable[]): void {
if (!this._callbacks) {
this._callbacks = [];
this._contexts = [];
}
this._callbacks.push(callback);
this._contexts!.push(context);
if (Array.isArray(bucket)) {
... | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
MethodDeclaration |
public remove(callback: Function, context: any = null): void {
if (!this._callbacks) {
return;
}
let foundCallbackWithDifferentContext = false;
for (let i = 0, len = this._callbacks.length; i < len; i++) {
if (this._callbacks[i] === callback) {
i... | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
MethodDeclaration |
public invoke(...args: any[]): any[] {
if (!this._callbacks) {
return [];
}
const ret: any[] = [];
const callbacks = this._callbacks.slice(0);
const contexts = this._contexts!.slice(0);
for (let i = 0, len = callbacks.length; i < len; i++) {
try... | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
MethodDeclaration |
public isEmpty(): boolean {
return !this._callbacks || this._callbacks.length === 0;
} | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
MethodDeclaration |
public dispose(): void {
this._callbacks = undefined;
this._contexts = undefined;
} | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
MethodDeclaration | /**
* To be kept private to fire an event to
* subscribers
*/
fire(event: T): any {
if (this._callbacks) {
this._callbacks.invoke.call(this._callbacks, event);
}
} | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
MethodDeclaration |
dispose() {
if (this._callbacks) {
this._callbacks.dispose();
this._callbacks = undefined;
}
} | JPinkney/theia | packages/core/src/common/event.ts | TypeScript |
ArrowFunction |
(): ElasticsearchQueryBuilderPlugin => ({
type: "cms-elastic-search-query-builder",
name: "elastic-search-query-builder-between",
operator: "between",
apply(query, { field, value }) {
if (Array.isArray(value) === false) {
throw new Error(
`You cannot filter "${field}... | Varulv1997/webiny-js | packages/api-headless-cms/src/content/plugins/es/elasticSearchQueryBuilderBetweenPlugin.ts | TypeScript |
MethodDeclaration |
apply(query, { field, value }) {
if (Array.isArray(value) === false) {
throw new Error(
`You cannot filter "${field}" with between query and not send an array of values.`
);
} else if (value.length !== 2) {
throw new Error(`You must pass 2 values in t... | Varulv1997/webiny-js | packages/api-headless-cms/src/content/plugins/es/elasticSearchQueryBuilderBetweenPlugin.ts | TypeScript |
ArrowFunction |
() => {
it('replaces the fields by address fields for Japan', () => {
const template = '{country} - {city} {zip} {province}';
expect(renderLineTemplate(Canada, template, address)).toEqual(
'Canada - 目黒区 100-8994',
);
});
it('replaces non existing province by empty string', () => {
const te... | colinrcummings/quilt | packages/address/src/tests/utilities.test.ts | TypeScript |
ArrowFunction |
() => {
const template = '{country} - {city} {zip} {province}';
expect(renderLineTemplate(Canada, template, address)).toEqual(
'Canada - 目黒区 100-8994',
);
} | colinrcummings/quilt | packages/address/src/tests/utilities.test.ts | TypeScript |
ArrowFunction |
() => {
const template = '{country} - {city} {zip} {province}';
expect(
renderLineTemplate(Canada, template, {
...address,
province: 'lol',
}),
).toEqual('Canada - 目黒区 100-8994');
} | colinrcummings/quilt | packages/address/src/tests/utilities.test.ts | TypeScript |
ArrowFunction |
() => {
const template = '{country} - {city} {zip} {province} {what}';
expect(renderLineTemplate(Canada, template, address)).toEqual(
'Canada - 目黒区 100-8994',
);
} | colinrcummings/quilt | packages/address/src/tests/utilities.test.ts | TypeScript |
ArrowFunction |
() => {
const template = '{firstName} - {lastName}';
expect(renderLineTemplate(Canada, template, address)).toEqual('');
} | colinrcummings/quilt | packages/address/src/tests/utilities.test.ts | TypeScript |
ArrowFunction |
() => {
const template = '[Nope]';
expect(renderLineTemplate(Canada, template, address)).toEqual('');
} | colinrcummings/quilt | packages/address/src/tests/utilities.test.ts | TypeScript |
ArrowFunction |
() => {
const template = '{province}';
expect(
renderLineTemplate(Canada, template, {
...address,
province: 'NOPE',
}),
).toEqual('');
} | colinrcummings/quilt | packages/address/src/tests/utilities.test.ts | TypeScript |
FunctionDeclaration |
function getPanelStateBadgeDisplayModel(panel: PanelPluginMeta): BadgeProps {
switch (panel.state) {
case PluginState.deprecated:
return {
text: 'Deprecated',
icon: 'exclamation-triangle',
color: 'red',
tooltip: `${panel.name} panel is deprecated`,
};
}
return {
... | 48N6E/grafana-7.3.2-CH | public/app/features/dashboard/panel_editor/VizTypePickerPlugin.tsx | TypeScript |
ArrowFunction |
({ isCurrent, plugin, onClick, disabled }) => {
const theme = useTheme();
const styles = getStyles(theme);
const cssClass = cx({
[styles.item]: true,
[styles.disabled]: disabled || plugin.state === PluginState.deprecated,
[styles.current]: isCurrent,
});
return (
<div className={styles.wrapp... | 48N6E/grafana-7.3.2-CH | public/app/features/dashboard/panel_editor/VizTypePickerPlugin.tsx | TypeScript |
ArrowFunction |
(theme: GrafanaTheme) => {
return {
wrapper: css`
position: relative;
`,
bg: css`
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: ${theme.colors.bg2};
border: 1px solid ${theme.colors.border2};
border-radius: 3px;
tra... | 48N6E/grafana-7.3.2-CH | public/app/features/dashboard/panel_editor/VizTypePickerPlugin.tsx | TypeScript |
ArrowFunction |
({ plugin }) => {
const display = getPanelStateBadgeDisplayModel(plugin);
if (isUnsignedPluginSignature(plugin.signature)) {
return <PluginSignatureBadge status={plugin.signature} />;
}
if (plugin.state !== PluginState.deprecated && plugin.state !== PluginState.alpha) {
return null;
}
return <Bad... | 48N6E/grafana-7.3.2-CH | public/app/features/dashboard/panel_editor/VizTypePickerPlugin.tsx | TypeScript |
InterfaceDeclaration |
interface Props {
isCurrent: boolean;
plugin: PanelPluginMeta;
onClick: () => void;
disabled: boolean;
} | 48N6E/grafana-7.3.2-CH | public/app/features/dashboard/panel_editor/VizTypePickerPlugin.tsx | TypeScript |
InterfaceDeclaration |
interface PanelPluginBadgeProps {
plugin: PanelPluginMeta;
} | 48N6E/grafana-7.3.2-CH | public/app/features/dashboard/panel_editor/VizTypePickerPlugin.tsx | TypeScript |
MethodDeclaration |
disabled ? () | 48N6E/grafana-7.3.2-CH | public/app/features/dashboard/panel_editor/VizTypePickerPlugin.tsx | TypeScript |
ArrowFunction |
context => context.i18n.t('welcome') | Elandig/telegram-typescript-bot-template | source/bot/menu/index.ts | TypeScript |
ArrowFunction |
context => '⚙️' + context.i18n.t('menu.settings') | Elandig/telegram-typescript-bot-template | source/bot/menu/index.ts | TypeScript |
ArrowFunction |
(item) => ({
title: item,
subTitle: <Tag color="#5BD8A6">语雀专栏</Tag>,
actions: [
<a>邀请</a>,
<a>操作</a>,
<a>
<EllipsisOutlined />
</a>,
],
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/UCSiy1j6jx/xingzhuang.svg',
content: (
<div
style={ | infra-fe/infrad-pro-components | packages/list/src/demos/pagination.tsx | TypeScript |
ArrowFunction |
() => {
return (
<ProList<any>
pagination={{
defaultPageSize: 5,
showSizeChanger: true,
}} | infra-fe/infrad-pro-components | packages/list/src/demos/pagination.tsx | TypeScript |
ClassDeclaration |
@Injectable()
@CommandHandler(LabDeregisteredCommand)
export class LabDeregisteredHandler implements ICommandHandler<LabDeregisteredCommand> {
constructor(private readonly elasticsearchService: ElasticsearchService) {}
async execute(command: LabDeregisteredCommand) {
const { labs: lab } = command;
await t... | kevinjanada/debio-indexer | src/substrate/labs/commands/lab-deregistered/lab-deregistered.handler.ts | TypeScript |
MethodDeclaration |
async execute(command: LabDeregisteredCommand) {
const { labs: lab } = command;
await this.elasticsearchService.delete({
index: 'labs',
id: lab.account_id,
});
await this.elasticsearchService.deleteByQuery({
index: 'services',
body: {
query: {
match: {
... | kevinjanada/debio-indexer | src/substrate/labs/commands/lab-deregistered/lab-deregistered.handler.ts | TypeScript |
ArrowFunction |
({ colorScheme }) => {
this.setState({ isDarkModeEnabled: colorScheme === 'dark' });
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
ArrowFunction |
() => {
this.setState({ showModal: true });
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
ArrowFunction |
(value: Date) => {
this.setState({ showModal: false }, () => {
this.props.onChange(value);
});
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
ArrowFunction |
() => {
this.props.onChange(value);
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
ArrowFunction |
() => {
this.setState({ showModal: false }, () => {
if (this.props.onCancel) {
this.props.onCancel();
}
});
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
ArrowFunction |
() => {
if (this.props.onCancel) {
this.props.onCancel();
}
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
ArrowFunction |
() => {
this.props.onChange(undefined);
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
ArrowFunction |
() => {
const theme = getTheme();
const styles = StyleSheet.create({
container: {
paddingLeft: 16,
paddingRight: 4,
paddingVertical: 8,
borderWidth: 1,
borderColor: theme.borderColor1,
borderRadius: 3,
flexDirection: 'row',
alignItems: 'cen... | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
ClassDeclaration |
export class DatePicker extends React.Component<
DatePickerProperties,
DatePickerState
> {
static defaultProps = {
clearable: true
};
state: DatePickerState = {
showModal: false,
isDarkModeEnabled: Appearance.getColorScheme() === 'dark'
};
appearanceSubscription: any;
componentDidMount()... | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
InterfaceDeclaration |
export interface DatePickerProperties {
label: string;
value?: Date;
clearable?: boolean;
onChange: (value?: Date) => void;
onCancel?: () => void;
style?: StyleProp<ViewStyle>;
nativeID?: string;
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
InterfaceDeclaration |
export interface DatePickerState {
showModal: boolean;
isDarkModeEnabled: boolean;
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
MethodDeclaration |
componentDidMount() {
this.appearanceSubscription = Appearance.addChangeListener(
({ colorScheme }) => {
this.setState({ isDarkModeEnabled: colorScheme === 'dark' });
}
);
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
MethodDeclaration |
componentWillUnmount() {
this.appearanceSubscription.remove();
} | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
MethodDeclaration |
render() {
const { label, value, clearable, style, nativeID } = this.props;
const { showModal, isDarkModeEnabled } = this.state;
const styles = this.getStyles();
const theme = getTheme();
return (
<TouchableWithoutFeedback onPress={this.handlePress}>
<View nativeID={nativeID} style={... | RodrigoAWeber/secullum-react-native-ui | src/components/DatePicker.tsx | TypeScript |
ClassDeclaration |
export class TypeormRepositoryPaginator {
private findOptions : TypeormRepositoryPaginatorFindOptionsInterface
private result : TypeormRepositoryPaginatorResultInterface
constructor(private repository: Repository<ObjectLiteral>, private paginatorOptions?: TypeormRepositoryPaginatorOptionsInterface)
{
... | peter-vincze/nest-entity | src/typeormrepositorypaginator/typeorm.repository.paginator.ts | TypeScript |
MethodDeclaration |
public async paginate() : Promise<TypeormRepositoryPaginatorResultInterface> {
const result = await this.resulter()
console.log(result)
let last : number = result[1] == 0 ? 0 :
(Math.trunc(result[1] / this.paginatorOptions.limit) +
(result[1]/this.paginatorOptions.limit... | peter-vincze/nest-entity | src/typeormrepositorypaginator/typeorm.repository.paginator.ts | TypeScript |
MethodDeclaration |
private setResultInterface() {
this.result = {data: [], paginator: this.setPaginatorInterface()}
} | peter-vincze/nest-entity | src/typeormrepositorypaginator/typeorm.repository.paginator.ts | TypeScript |
MethodDeclaration |
private async resulter() {
return await this.repository.findAndCount(this.findOptions);
} | peter-vincze/nest-entity | src/typeormrepositorypaginator/typeorm.repository.paginator.ts | TypeScript |
MethodDeclaration |
private setPaginatorInterface() {
return {
total: 0,
first: 1,
prev : 1,
next : 1,
last : 1,
}
} | peter-vincze/nest-entity | src/typeormrepositorypaginator/typeorm.repository.paginator.ts | TypeScript |
MethodDeclaration |
private setOptions()
{
let paginatorOptions = this.setInterfaced();
paginatorOptions.find = this.paginatorOptions.find ? this.paginatorOptions.find : {}
paginatorOptions.page = (this.paginatorOptions.page ?
(Math.abs(this.paginatorOptions.page) === 0 ? 1 : Math.abs(this.paginat... | peter-vincze/nest-entity | src/typeormrepositorypaginator/typeorm.repository.paginator.ts | TypeScript |
MethodDeclaration |
private setFindOptions() {
let findOptions = {skip: 0, limit: 15}
for(let option in this.paginatorOptions.find){
findOptions[option] = this.paginatorOptions.find[option]
}
this.findOptions = findOptions
} | peter-vincze/nest-entity | src/typeormrepositorypaginator/typeorm.repository.paginator.ts | TypeScript |
MethodDeclaration |
private setInterfaced() : TypeormRepositoryPaginatorOptionsInterface {
return {
find: {},
page: 1,
limit: 15,
order: {},
limitAbility: [],
orderAbility: [],
route: '',
query: {
page: 'page',
... | peter-vincze/nest-entity | src/typeormrepositorypaginator/typeorm.repository.paginator.ts | TypeScript |
MethodDeclaration |
private filterConditions() {
let paginatorOptions = this.setInterfaced();
for (let option in this.paginatorOptions.find) {
if (!(['skip', 'limit', 'order'].indexOf(option) > -1)) {
paginatorOptions[option] = this.paginatorOptions.find[option];
}
}
... | peter-vincze/nest-entity | src/typeormrepositorypaginator/typeorm.repository.paginator.ts | TypeScript |
ArrowFunction |
(user) => {
this.user = user;
} | RyanEllingson/Plant-Maintenance-System | client/src/app/shared/navbar/navbar.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.css'],
})
export class NavbarComponent implements OnInit {
public user: User;
constructor(private authService: AuthService) {}
ngOnInit(): void {
this.authService.user$.subscribe((user) => {
... | RyanEllingson/Plant-Maintenance-System | client/src/app/shared/navbar/navbar.component.ts | TypeScript |
MethodDeclaration |
ngOnInit(): void {
this.authService.user$.subscribe((user) => {
this.user = user;
});
} | RyanEllingson/Plant-Maintenance-System | client/src/app/shared/navbar/navbar.component.ts | TypeScript |
ArrowFunction |
(node: VNode): boolean => {
return !node.tag && /^\s$/.test(node.text ?? "");
} | Kunduin/vue-space | packages/core/src/utils/judgeNode.ts | TypeScript |
ArrowFunction |
() => {
const rewardPointsLink = (
<Link.About type="rewards" size="inherit">
<FormattedMessage {...SharedComponentMessages.RewardPoints}/>
</Link.About> | NarrativeCompany/narrative | react-ui/packages/web/src/shared/components/rewards/UnderstandingNarrativePointsSection.tsx | TypeScript |
ArrowFunction |
() => {
const { availableHotspots } = useConnectedHotspotContext()
const hotspotCount = Object.keys(availableHotspots).length
if (hotspotCount > 0) {
return (
<BackScreen backgroundColor="primaryBackground" padding="none">
<HotspotSetupBluetoothSuccess />
</BackScreen> | PY-Foundation-Group-SA/hotspot-app | src/features/hotspots/setup/HotspotSetupPickHotspotScreen.tsx | TypeScript |
ArrowFunction |
(props: JsonFormsProps) => {
const labelEl = props.uischema as LabelElement;
this.label = labelEl.text;
} | iggh/jsonforms | packages/ionic/src/other/label/label.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'label',
template: `
<ion-item>
<ion-label> {{ label }} </ion-label>
</ion-item>
`
})
export class LabelRenderer extends JsonFormsIonicLayout {
label: string;
constructor(ngRedux: NgRedux<JsonFormsState>) {
super(ngRedux);
this.initializers.push((props: JsonForms... | iggh/jsonforms | packages/ionic/src/other/label/label.ts | TypeScript |
ArrowFunction |
(n: number): number => Math.round(n * 100) / 100 | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(l: number, r: number): number => round2(l + r) | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(l: number, r: number): number => round2(l - r) | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(l: number, r: number): number => round2(l * r) | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(l: number, r: number): number => round2(l / r) | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(model: CalculatorModel): CalculatorModel => {
if (model.operator && model.left && model.right) {
const l = Number.parseFloat(model.left);
const r = Number.parseFloat(model.right);
const result = Operations[model.operator](l, r);
const left = result.toString();
return { result, left, operator: mo... | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(
id: string
): Aggregate<
CalculatorModel,
Omit<Commands, "Whatever" | "Forget">,
Omit<Events, "Ignored1" | "Ignored2" | "Forgotten">
> => ({
snapshot: {
factory: InMemorySnapshotStore,
threshold: 2
},
stream: () => `Calculator-${id}`,
schema: () => schemas.CalculatorModel,
init: (): Calcu... | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
() => `Calculator-${id}` | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
() => schemas.CalculatorModel | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(): CalculatorModel => ({
result: 0
}) | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(model, event) => {
if (model.operator) {
const right = (model.right || "").concat(event.data.digit);
return { ...model, right };
}
const left = (model.left || "").concat(event.data.digit);
return { ...model, left };
} | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(model, event) => {
if (model.left) {
const newmodel = compute(model);
return { ...newmodel, operator: event.data.operator };
}
return { ...model };
} | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(model) => {
if (model.operator) {
const right = (model.right || "").concat(".");
return { ...model, right };
}
const left = (model.left || "").concat(".");
return { ...model, left };
} | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(model) => compute(model) | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
() => ({
result: 0
}) | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
ArrowFunction |
(model) => model | Rotorsoft/eventually-monorepo | services/calculator/src/calculator.aggregate.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.