type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
InterfaceDeclaration |
export interface Service {
hello: PostReq<string, string>;
farewell: PostReq<(string|null), (string|null)>;
blobs: CrudReqs<{}|null>;
} | bacek/adl | haskell/compiler/tests/test24/ts-output/test24.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: ActivityListService = TestBed.get(ActivityListService);
expect(service).toBeTruthy();
});
} | m91michel/scrum-retro-planner | src/app/services/activity-list.service.spec.ts | TypeScript |
ArrowFunction |
() => TestBed.configureTestingModule({}) | m91michel/scrum-retro-planner | src/app/services/activity-list.service.spec.ts | TypeScript |
ArrowFunction |
() => {
const service: ActivityListService = TestBed.get(ActivityListService);
expect(service).toBeTruthy();
} | m91michel/scrum-retro-planner | src/app/services/activity-list.service.spec.ts | TypeScript |
InterfaceDeclaration |
interface ReceivedInvitationMetadata {
$type: 'com.linkedin.voyager.common.CollectionMetadata';
paginationToken: string;
} | brunohafonso95/linkedin-private-api | src/responses/received-invitations.response.get.ts | TypeScript |
TypeAliasDeclaration |
export type GetReceivedInvitationResponse = LinkedInCollectionResponse<
string,
MiniProfile | LinkedInInvitation,
ReceivedInvitationMetadata
>; | brunohafonso95/linkedin-private-api | src/responses/received-invitations.response.get.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-chart',
templateUrl: './chart.component.html',
styleUrls: ['./chart.component.scss']
})
export class ChartComponent implements OnInit {
types: string[] = ["spline", "stackedspline", "fullstackedspline"];
constructor() { }
architecturesInfo: any[] = [{
year: 1997,
flow... | yeuho938/Dev-Angular-New-Version | src/app/modules/admin/components/chart/chart.component.ts | TypeScript |
ArrowFunction |
(props: ListActionsProps) => {
const [isOpen, setIsOpen] = useState(false);
return (
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
<EuiFlexItem grow={false} style={{ marginRight: '16px' }} | AMoo-Miki/anomaly-detection-dashboards-plugin | public/pages/DetectorsList/components/ListActions/ListActions.tsx | TypeScript |
InterfaceDeclaration |
interface ListActionsProps {
onStartDetectors(): void;
onStopDetectors(): void;
onDeleteDetectors(): void;
isActionsDisabled: boolean;
isStartDisabled: boolean;
isStopDisabled: boolean;
} | AMoo-Miki/anomaly-detection-dashboards-plugin | public/pages/DetectorsList/components/ListActions/ListActions.tsx | TypeScript |
ArrowFunction |
() => {
it('create an instance', () => {
const pipe = new SlotByDayPipe();
expect(pipe).toBeTruthy();
});
} | Basileum/angular6-scheduler | scheduler6/src/app/utils/scheduler/multislider/slot-by-day.pipe.spec.ts | TypeScript |
ArrowFunction |
() => {
const pipe = new SlotByDayPipe();
expect(pipe).toBeTruthy();
} | Basileum/angular6-scheduler | scheduler6/src/app/utils/scheduler/multislider/slot-by-day.pipe.spec.ts | TypeScript |
ArrowFunction |
() => ({
election_seen_penalty: 0.0033333,
election_removal_pct: 40,
price_oracle_public_keys: [
'13Btezbvbwr9LhKmDQLgBnJUgjhZighEjNPLeu79dqBbmXRwoWm',
'13CFFcmPtMvNQCpWQRXCTqXPnXtcsibDWVwiQRKpUCt4nqtF7RE',
'1431WVQvoV7RAJpoLCaBrTKner1Soed4bk69DddcrHUTCWHV6pj',
'136n9BEbreGUNgXJWtyzkBQcXiNzdMQ5GB... | HeliumEx/helium-js | packages/http/src/resources/__tests__/Vars.spec.ts | TypeScript |
ArrowFunction |
() => {
nock('https://api.helium.io').get('/v1/vars').reply(200, {
data: varsFixture(),
})
it('retrieves chain vars', async () => {
const client = new Client()
const vars = await client.vars.get()
expect(vars.electionRemovalPct).toBe(40)
expect(vars.priceOraclePublicKeys[0]).toBe(
'13B... | HeliumEx/helium-js | packages/http/src/resources/__tests__/Vars.spec.ts | TypeScript |
ArrowFunction |
async () => {
const client = new Client()
const vars = await client.vars.get()
expect(vars.electionRemovalPct).toBe(40)
expect(vars.priceOraclePublicKeys[0]).toBe(
'13Btezbvbwr9LhKmDQLgBnJUgjhZighEjNPLeu79dqBbmXRwoWm',
)
} | HeliumEx/helium-js | packages/http/src/resources/__tests__/Vars.spec.ts | TypeScript |
ArrowFunction |
(feedbackInfo: FeedbackInfo): string => {
const { product, packageName, packageVersion, labels } = feedbackInfo;
return [product, packageName, packageVersion, ...(labels || [])].join('|');
} | cozy/editor-core | src/plugins/feedback-dialog/index.tsx | TypeScript |
ArrowFunction |
async (feedbackInfo?: FeedbackInfo) =>
new Promise(async (resolve, reject) => {
const combinedFeedbackInfo = {
// default value assignment
...{
product: 'n/a',
labels: [],
packageName: '',
packageVersion: '',
sessionId: '',
contentId: '',
tabId:... | cozy/editor-core | src/plugins/feedback-dialog/index.tsx | TypeScript |
ArrowFunction |
async (resolve, reject) => {
const combinedFeedbackInfo = {
// default value assignment
...{
product: 'n/a',
labels: [],
packageName: '',
packageVersion: '',
sessionId: '',
contentId: '',
tabId: '',
},
...defaultFeedbackInfo,
...... | cozy/editor-core | src/plugins/feedback-dialog/index.tsx | TypeScript |
ArrowFunction |
(feedbackInfo: FeedbackInfo): EditorPlugin => {
defaultFeedbackInfo = feedbackInfo;
return {
name: 'feedbackDialog',
pluginsOptions: {
quickInsert: ({ formatMessage }) => [
{
id: 'feedbackdialog',
title: formatMessage(messages.feedbackDialog),
description: forma... | cozy/editor-core | src/plugins/feedback-dialog/index.tsx | TypeScript |
ArrowFunction |
({ formatMessage }) => [
{
id: 'feedbackdialog',
title: formatMessage(messages.feedbackDialog),
description: formatMessage(messages.feedbackDialogDescription),
priority: 400,
keywords: ['bug'],
icon: () => <IconFeedback />,
action(insert, st... | cozy/editor-core | src/plugins/feedback-dialog/index.tsx | TypeScript |
ArrowFunction |
() => <IconFeedback />, | cozy/editor-core | src/plugins/feedback-dialog/index.tsx | TypeScript |
MethodDeclaration |
action(insert, state) {
const tr = insert('');
openFeedbackDialog(feedbackInfo);
return addAnalytics(state, tr, {
action: ACTION.OPENED,
actionSubject: ACTION_SUBJECT.FEEDBACK_DIALOG,
attributes: { inputMethod: INPUT_METHOD.QUICK_INSERT },
... | cozy/editor-core | src/plugins/feedback-dialog/index.tsx | TypeScript |
ArrowFunction |
async () => {
if (!req.body || !req.body.isbn || !req.body.name) {
throw new Error("Missing required fields for product");
}
const isbn = req.body.isbn;
const name = req.body.name;
const product = new Product();
product.isbn = isb... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
e => {
throw new Error(e);
} | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
async () => {
if (!req.body || !req.body.isbn) {
throw new Error("Missing required fields for product delete");
}
const isbn = req.body.isbn;
return await ProductController.deleteProduct(isbn)
.catch(e => {
throw new E... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
async () => {
if (!req.body || !req.body.product || !req.body.product.isbn) {
throw new Error("Missing required fields for product update");
}
let product = req.body.product as ProductDocument;
return await ProductController.updateProduct(product)
... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
async () => {
if (!req.body || !req.body.pRequest || !req.body.isbn) {
throw new Error("Missing required fields for adding requests");
}
let isbn = req.body.isbn;
let pRequest = req.body.pRequest as ProductRequest;
pRequest.createdAt = Date.no... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
async () => {
if (!req.body || !req.body.isbn) {
throw new Error("Missing required fields for adding to inventory");
}
let isbn = req.body.isbn;
return await ProductController.addToInventory(isbn)
.catch(e => {
throw ne... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
Product.find((err, data) => {
if (err) {
reject(err);
} else {
resolve(data);
}
});
} | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
(err, data) => {
if (err) {
reject(err);
} else {
resolve(data);
}
} | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
Product.find({isbn: product.isbn}, async (err, data) => {
if (err) {
reject(err);
} else if (data && data.length > 0) {
reject(new Error("already exists"));
} else {
const save... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
async (err, data) => {
if (err) {
reject(err);
} else if (data && data.length > 0) {
reject(new Error("already exists"));
} else {
const savedProduct = await product.save();
resolve(savedProd... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
Product.findOne({isbn: isbn}, async (err, product) => {
if (err) {
reject(err);
} else if (product) {
resolve(await product.remove());
} else {
reject("not found");
... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
async (err, product) => {
if (err) {
reject(err);
} else if (product) {
resolve(await product.remove());
} else {
reject("not found");
}
} | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
Product.findOneAndUpdate({isbn: product.isbn}, product, {new: true},async (err, newProduct) => {
if (err) {
reject(err);
} else if (newProduct) {
resolve(newProduct);
} else {
... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
async (err, newProduct) => {
if (err) {
reject(err);
} else if (newProduct) {
resolve(newProduct);
} else {
reject("product not found");
}
} | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
Product.findOne({isbn: isbn}, async (err, product: ProductDocument) => {
if (err) {
reject(err);
} else if (product) {
product.requests = [...product.requests, pRequest];
await product.save((e... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
async (err, product: ProductDocument) => {
if (err) {
reject(err);
} else if (product) {
product.requests = [...product.requests, pRequest];
await product.save((err, newProduct) => {
if (err) {
... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
(err, newProduct) => {
if (err) {
reject(err);
} else {
resolve(newProduct);
}
} | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
Product.findOne({isbn: isbn}, async (err, product: ProductDocument) => {
if (err) {
reject(err);
} else if (product) {
product.quantity += 1;
let index = product.requests.findIndex(x => x.isAc... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
async (err, product: ProductDocument) => {
if (err) {
reject(err);
} else if (product) {
product.quantity += 1;
let index = product.requests.findIndex(x => x.isActive);
if (index > -1) {
... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
x => x.isActive | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
(err, newProduct) => {
if (err) {
reject(err);
} else {
resolve(newProduct);
}
} | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ClassDeclaration |
export default class ProductController {
public static async getList(req: Request, res: Response) {
return await jsonResponse(res, ProductController.getAllProducts);
}
public static async create(req: Request, res: Response) {
await jsonResponse(res, async () => {
if (!req.body... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
public static async getList(req: Request, res: Response) {
return await jsonResponse(res, ProductController.getAllProducts);
} | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
public static async create(req: Request, res: Response) {
await jsonResponse(res, async () => {
if (!req.body || !req.body.isbn || !req.body.name) {
throw new Error("Missing required fields for product");
}
const isbn = req.body.isbn;
const name ... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
public static async delete(req: Request, res: Response) {
await jsonResponse(res, async () => {
if (!req.body || !req.body.isbn) {
throw new Error("Missing required fields for product delete");
}
const isbn = req.body.isbn;
return await ProductCo... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
public static async update(req: Request, res: Response) {
await jsonResponse(res, async () => {
if (!req.body || !req.body.product || !req.body.product.isbn) {
throw new Error("Missing required fields for product update");
}
let product = req.body.product as ... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
public static async addRequest(req: Request, res: Response) {
await jsonResponse(res, async () => {
if (!req.body || !req.body.pRequest || !req.body.isbn) {
throw new Error("Missing required fields for adding requests");
}
let isbn = req.body.isbn;
... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
public static async addInventory(req: Request, res: Response) {
await jsonResponse(res, async () => {
if (!req.body || !req.body.isbn) {
throw new Error("Missing required fields for adding to inventory");
}
let isbn = req.body.isbn;
return await P... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
public static async getAllProducts() {
return new Promise((resolve, reject) => {
Product.find((err, data) => {
if (err) {
reject(err);
} else {
resolve(data);
}
});
});
} | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
private static async saveProduct(product: ProductDocument) {
return new Promise((resolve, reject) => {
Product.find({isbn: product.isbn}, async (err, data) => {
if (err) {
reject(err);
} else if (data && data.length > 0) {
reje... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
private static async deleteProduct(isbn: string) {
return new Promise((resolve, reject) => {
Product.findOne({isbn: isbn}, async (err, product) => {
if (err) {
reject(err);
} else if (product) {
resolve(await product.remove());... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
private static async updateProduct(product: ProductDocument) {
return new Promise((resolve, reject) => {
Product.findOneAndUpdate({isbn: product.isbn}, product, {new: true},async (err, newProduct) => {
if (err) {
reject(err);
} else if (newProduct... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
private static async addProductRequest(isbn: string, pRequest: ProductRequest) {
return new Promise((resolve, reject) => {
Product.findOne({isbn: isbn}, async (err, product: ProductDocument) => {
if (err) {
reject(err);
} else if (product) {
... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
MethodDeclaration |
private static async addToInventory(isbn: string) {
return new Promise((resolve, reject) => {
Product.findOne({isbn: isbn}, async (err, product: ProductDocument) => {
if (err) {
reject(err);
} else if (product) {
product.quanti... | rotemgrim/accessibe-inventory | back/src/controllers/ProductController.ts | TypeScript |
ArrowFunction |
(editor: Editor, api: WordCountApi) => {
Events.fireWordCountUpdate(editor, api);
} | Azel333/animasi | asset/vendor/tinymce/modules/tinymce/src/plugins/wordcount/main/ts/core/WordCounter.ts | TypeScript |
ArrowFunction |
(editor: Editor, api: WordCountApi, delay: number) => {
const debouncedUpdate = Delay.debounce(() => updateCount(editor, api), delay);
editor.on('init', () => {
updateCount(editor, api);
Delay.setEditorTimeout(editor, () => {
editor.on('SetContent BeforeAddUndo Undo Redo keyup', debouncedUpdate);
... | Azel333/animasi | asset/vendor/tinymce/modules/tinymce/src/plugins/wordcount/main/ts/core/WordCounter.ts | TypeScript |
ArrowFunction |
() => updateCount(editor, api) | Azel333/animasi | asset/vendor/tinymce/modules/tinymce/src/plugins/wordcount/main/ts/core/WordCounter.ts | TypeScript |
ArrowFunction |
() => {
updateCount(editor, api);
Delay.setEditorTimeout(editor, () => {
editor.on('SetContent BeforeAddUndo Undo Redo keyup', debouncedUpdate);
}, 0);
} | Azel333/animasi | asset/vendor/tinymce/modules/tinymce/src/plugins/wordcount/main/ts/core/WordCounter.ts | TypeScript |
ArrowFunction |
() => {
editor.on('SetContent BeforeAddUndo Undo Redo keyup', debouncedUpdate);
} | Azel333/animasi | asset/vendor/tinymce/modules/tinymce/src/plugins/wordcount/main/ts/core/WordCounter.ts | TypeScript |
ArrowFunction |
data=>{
this.ipos=data;
} | prasannachinnapareddy/StockExchage | final/src/app/updateipodetails/updateipodetails.component.ts | TypeScript |
ArrowFunction |
data=>{
this.ipos=this.ipos.filter(ipos => ipos.id !== id);
} | prasannachinnapareddy/StockExchage | final/src/app/updateipodetails/updateipodetails.component.ts | TypeScript |
ArrowFunction |
ipos => ipos.id !== id | prasannachinnapareddy/StockExchage | final/src/app/updateipodetails/updateipodetails.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-updateipodetails',
templateUrl: './updateipodetails.component.html',
styleUrls: ['./updateipodetails.component.css']
})
export class UpdateipodetailsComponent implements OnInit {
constructor(private ipoService :IpoService, private router : Router) {}
ipos:Ipo[];
ngOnInit() {
... | prasannachinnapareddy/StockExchage | final/src/app/updateipodetails/updateipodetails.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.ipoService.getAllIpos().subscribe(data=>{
this.ipos=data;
})
} | prasannachinnapareddy/StockExchage | final/src/app/updateipodetails/updateipodetails.component.ts | TypeScript |
MethodDeclaration |
deleteIpo(id:number)
{
this.ipoService.deleteIpo(id).subscribe(data=>{
this.ipos=this.ipos.filter(ipos => ipos.id !== id);
});
} | prasannachinnapareddy/StockExchage | final/src/app/updateipodetails/updateipodetails.component.ts | TypeScript |
MethodDeclaration |
updateIpo(ipos: Ipo) {
localStorage.removeItem('ipoId');
localStorage.setItem('ipoId', ipos.id.toString());
this.router.navigate(['ipo-update']);
} | prasannachinnapareddy/StockExchage | final/src/app/updateipodetails/updateipodetails.component.ts | TypeScript |
FunctionDeclaration |
function ShortcutPage({ file, renderStackOffset = 0 }: IShortcutPageProps) {
useManagedRenderStack({
depth: renderStackOffset,
id: 'ShortcutPage',
file,
});
const { file: pointingFile, loading, error } = useFileMeta(file.shortcutDetails?.targetId);
return (
<>
{loading && <InlineLoading ... | cw1997/gdocwiki | src/pages/ContentPage/ShortcutPage.tsx | TypeScript |
InterfaceDeclaration |
export interface IShortcutPageProps {
file: gapi.client.drive.File;
renderStackOffset?: number;
} | cw1997/gdocwiki | src/pages/ContentPage/ShortcutPage.tsx | TypeScript |
FunctionDeclaration |
export default function getStyle(theme: Theme = {}) {
const appStyle = {...defaultStyle, ...theme};
return StyleSheet.create({
container: {
paddingLeft: 5,
paddingRight: 5,
backgroundColor: appStyle.calendarBackground
},
dayContainer: {
flex: 1,
alignItems: 'center'
},... | riamon-v/react-native-calendars | src/calendar/style.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
url = url.replace(/^http/, "ws");
const webSocket = new this.webSocketConstructor(url);
if (transferFormat === TransferFormat.Binary) {
webSocket.binaryType = "arraybuffer";
}
// tslint:disable-next-line:variable-name
... | FraserKillip/SignalR | clients/ts/signalr/src/WebSocketTransport.ts | TypeScript |
ArrowFunction |
(_event: Event) => {
this.logger.log(LogLevel.Information, `WebSocket connected to ${url}`);
this.webSocket = webSocket;
resolve();
} | FraserKillip/SignalR | clients/ts/signalr/src/WebSocketTransport.ts | TypeScript |
ArrowFunction |
(event: Event) => {
let error: any = null;
// ErrorEvent is a browser only type we need to check if the type exists before using it
if (typeof ErrorEvent !== "undefined" && event instanceof ErrorEvent) {
error = event.error;
}
... | FraserKillip/SignalR | clients/ts/signalr/src/WebSocketTransport.ts | TypeScript |
ArrowFunction |
(message: MessageEvent) => {
this.logger.log(LogLevel.Trace, `(WebSockets transport) data received. ${getDataDetail(message.data, this.logMessageContent)}.`);
if (this.onreceive) {
this.onreceive(message.data);
}
} | FraserKillip/SignalR | clients/ts/signalr/src/WebSocketTransport.ts | TypeScript |
ArrowFunction |
(event: CloseEvent) => this.close(event) | FraserKillip/SignalR | clients/ts/signalr/src/WebSocketTransport.ts | TypeScript |
ClassDeclaration | /** @private */
export class WebSocketTransport implements ITransport {
private readonly logger: ILogger;
private readonly accessTokenFactory: (() => string | Promise<string>) | undefined;
private readonly logMessageContent: boolean;
private readonly webSocketConstructor: WebSocketConstructor;
priva... | FraserKillip/SignalR | clients/ts/signalr/src/WebSocketTransport.ts | TypeScript |
MethodDeclaration |
public async connect(url: string, transferFormat: TransferFormat): Promise<void> {
Arg.isRequired(url, "url");
Arg.isRequired(transferFormat, "transferFormat");
Arg.isIn(transferFormat, TransferFormat, "transferFormat");
this.logger.log(LogLevel.Trace, "(WebSockets transport) Connectin... | FraserKillip/SignalR | clients/ts/signalr/src/WebSocketTransport.ts | TypeScript |
MethodDeclaration |
public send(data: any): Promise<void> {
if (this.webSocket && this.webSocket.readyState === this.webSocketConstructor.OPEN) {
this.logger.log(LogLevel.Trace, `(WebSockets transport) sending data. ${getDataDetail(data, this.logMessageContent)}.`);
this.webSocket.send(data);
r... | FraserKillip/SignalR | clients/ts/signalr/src/WebSocketTransport.ts | TypeScript |
MethodDeclaration |
public stop(): Promise<void> {
if (this.webSocket) {
// Clear websocket handlers because we are considering the socket closed now
this.webSocket.onclose = () => {};
this.webSocket.onmessage = () => {};
this.webSocket.onerror = () => {};
this.webSocket... | FraserKillip/SignalR | clients/ts/signalr/src/WebSocketTransport.ts | TypeScript |
MethodDeclaration |
private close(event?: CloseEvent): void {
// webSocket will be null if the transport did not start successfully
this.logger.log(LogLevel.Trace, "(WebSockets transport) socket closed.");
if (this.onclose) {
if (event && (event.wasClean === false || event.code !== 1000)) {
... | FraserKillip/SignalR | clients/ts/signalr/src/WebSocketTransport.ts | TypeScript |
ArrowFunction |
({
host,
password,
port,
username,
}: Mqtt): Promise<Server> => {
return new Promise((resolve: (server: Server) => void): void => {
const server = new Server({
host,
port,
});
server.on('ready', () => {
if (username && password) {
... | TonyBrobston/logs-to-mqtt-publisher | tests/utils/moscaHelper.ts | TypeScript |
ArrowFunction |
(resolve: (server: Server) => void): void => {
const server = new Server({
host,
port,
});
server.on('ready', () => {
if (username && password) {
server.authenticate = (client: {}, actualUsername: string, actualPassword: string,
... | TonyBrobston/logs-to-mqtt-publisher | tests/utils/moscaHelper.ts | TypeScript |
ArrowFunction |
() => {
if (username && password) {
server.authenticate = (client: {}, actualUsername: string, actualPassword: string,
callback: (error: null, authenticated: boolean) => void): void => {
const authenticated = actualUsername === user... | TonyBrobston/logs-to-mqtt-publisher | tests/utils/moscaHelper.ts | TypeScript |
ArrowFunction |
(client: {}, actualUsername: string, actualPassword: string,
callback: (error: null, authenticated: boolean) => void): void => {
const authenticated = actualUsername === username && actualPassword.toString() === password;
callback(null, aut... | TonyBrobston/logs-to-mqtt-publisher | tests/utils/moscaHelper.ts | TypeScript |
FunctionDeclaration |
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.useGlobalPipes(new ValidationPipe());
const config = new DocumentBuilder()
.setTitle('homework example')
.setDescription('The homework API description')
.setVersion('1.0')
.addTag('homework')
.build();
const d... | slilp/example-nestjs-typeorm | src/main.ts | TypeScript |
FunctionDeclaration |
function App() {
return (
<Routes />
);
} | rafapaivadeandrade/Ecoleta | Web/src/App.tsx | TypeScript |
FunctionDeclaration |
function handleRequestSort(event: any, property: string) {
const isDesc = orderBy === property && order === 'desc';
setOrder(isDesc ? 'asc' : 'desc');
setOrderBy(property);
} | EYRA-Benchmark/eyra-frontend | src/components/AlgorithmsTable/index.tsx | TypeScript |
FunctionDeclaration |
function handleChangePage(event: any, newPage: number) {
setPage(newPage);
} | EYRA-Benchmark/eyra-frontend | src/components/AlgorithmsTable/index.tsx | TypeScript |
FunctionDeclaration |
function handleChangeRowsPerPage(event: any) {
setRowsPerPage(+event.target.value);
setPage(0);
} | EYRA-Benchmark/eyra-frontend | src/components/AlgorithmsTable/index.tsx | TypeScript |
ArrowFunction |
(props: IProps) => {
const algorithms = props.algorithms;
const [order, setOrder] = React.useState<Order>('asc');
const [orderBy, setOrderBy] = React.useState('Name');
const [page, setPage] = React.useState(0);
const [rowsPerPage, setRowsPerPage] = React.useState(3);
function handleRequestSort(event: any,... | EYRA-Benchmark/eyra-frontend | src/components/AlgorithmsTable/index.tsx | TypeScript |
ArrowFunction |
(algorithm) => (
<TableRow hover={true} | EYRA-Benchmark/eyra-frontend | src/components/AlgorithmsTable/index.tsx | TypeScript |
InterfaceDeclaration |
interface IProps {
showMore: boolean;
algorithms: IAlgorithm[];
onEdit: (algorithm: IAlgorithm) => void;
} | EYRA-Benchmark/eyra-frontend | src/components/AlgorithmsTable/index.tsx | TypeScript |
TypeAliasDeclaration | // Functions for Sorting
type Order = 'asc' | 'desc'; | EYRA-Benchmark/eyra-frontend | src/components/AlgorithmsTable/index.tsx | TypeScript |
MethodDeclaration |
moment(algorithm | EYRA-Benchmark/eyra-frontend | src/components/AlgorithmsTable/index.tsx | TypeScript |
FunctionDeclaration |
function SlideTransition(props: SlideProps) {
return <Slide {...props} direction="up" timeout={TRANSITION_TIMEOUT} />;
} | hyperledger/firefly-ui | src/components/Snackbar/MessageSnackbar.tsx | TypeScript |
ArrowFunction |
({
message,
setMessage,
messageType = 'error',
}) => {
const classes = useStyles();
const [open, setOpen] = useState(message ? true : false);
const timeoutRef = useRef<number>(0);
useEffect(() => {
return () => window.clearTimeout(timeoutRef.current);
}, []);
const handleClose = () => {
win... | hyperledger/firefly-ui | src/components/Snackbar/MessageSnackbar.tsx | TypeScript |
ArrowFunction |
() => {
return () => window.clearTimeout(timeoutRef.current);
} | hyperledger/firefly-ui | src/components/Snackbar/MessageSnackbar.tsx | TypeScript |
ArrowFunction |
() => window.clearTimeout(timeoutRef.current) | hyperledger/firefly-ui | src/components/Snackbar/MessageSnackbar.tsx | TypeScript |
ArrowFunction |
() => {
window.clearTimeout(timeoutRef.current);
setOpen(false);
timeoutRef.current = window.setTimeout(
() => setMessage(''),
TRANSITION_TIMEOUT
);
} | hyperledger/firefly-ui | src/components/Snackbar/MessageSnackbar.tsx | TypeScript |
ArrowFunction |
() => setMessage('') | hyperledger/firefly-ui | src/components/Snackbar/MessageSnackbar.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.