type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
_update(key: Buffer, val: Account, modified: boolean, deleted: boolean): void { const keyHex = key.toString('hex') const it = this._cache.find(keyHex) if (it.node) { this._cache = it.update({ val: val, modified: modified, deleted: deleted, }) } else { this._cac...
Aminadav/ethereumjs-vm
lib/state/cache.ts
TypeScript
InterfaceDeclaration
/* * Copyright 2020 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
AaronvDiepen/backstage
plugins/auth-backend/config.d.ts
TypeScript
ArrowFunction
resolve => { let resolver: IResolver = { handler: (this.writing_++ === 0 && this.reading_ === 0) ? null : resolve, accessType: AccessType.WRITE, lockType: LockType.HOLD }; this.queue_.pus...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
ArrowFunction
resolve => { // CONSTRUCT RESOLVER WITH PREDICATION let resolver: IResolver = { handler: (this.writing_++ === 0 && this.reading_ === 0) ? null : resolve, accessType: AccessType.WRITE, lockType: LockT...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
ArrowFunction
() => { // NOT YET, THEN DO UNLOCK if (it.value.handler !== null) { --this.writing_; this._Cancel(it); } }
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
ArrowFunction
resolve => { let resolver: IResolver = { handler: (this.writing_ === 0) ? null : resolve, accessType: AccessType.READ, lockType: LockType.HOLD } this.queue_.push_back(resolver); ...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
ArrowFunction
resolve => { // CONSTRUCT RESOLVER WITH PREDICATION let resolver: IResolver = { handler: (this.writing_ === 0) ? null : resolve, accessType: AccessType.READ, lockType: LockType.KNOCK }; ...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
ArrowFunction
() => { // NOT YET, THEN DO UNLOCK if (it.value.handler !== null) { --this.reading_; this._Cancel(it); } }
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
InterfaceDeclaration
/** * @hidden */ interface IResolver { handler: Function | null; accessType: AccessType; // read or write lockType: LockType; // void or boolean }
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
TypeAliasDeclaration
export type shared_timed_mutex = SharedTimedMutex;
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/** * @hidden */ private _Current_access_type(): AccessType | null { return this.queue_.empty() ? null : this.queue_.front().accessType; }
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/* --------------------------------------------------------- WRITE LOCK --------------------------------------------------------- */ /** * @inheritDoc */ public async lock(): Promise<void> { return new Promise<void>(resolve => { let resolver: IResolver = { ...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/** * @inheritDoc */ public async try_lock(): Promise<boolean> { if (this.writing_ !== 0 || this.reading_ !== 0) return false; ++this.writing_; this.queue_.push_back({ handler: null, accessType: AccessType.WRITE, lockType: LockType.K...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/** * @inheritDoc */ public try_lock_for(ms: number): Promise<boolean> { return new Promise<boolean>(resolve => { // CONSTRUCT RESOLVER WITH PREDICATION let resolver: IResolver = { handler: (this.writing_++ === 0 && this.reading_ === 0) ...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/** * @inheritDoc */ public try_lock_until(at: Date): Promise<boolean> { // COMPUTE MILLISECONDS TO WAIT let now: Date = new Date(); let ms: number = at.getTime() - now.getTime(); return this.try_lock_for(ms); }
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/** * @inheritDoc */ public async unlock(): Promise<void> { if (this._Current_access_type() !== AccessType.WRITE) throw new InvalidArgument(`Error on std.${this.source_.constructor.name}.unlock(): this mutex is free on the unique lock.`); --this.writing_; this.queue_.p...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/* --------------------------------------------------------- READ LOCK --------------------------------------------------------- */ /** * @inheritDoc */ public async lock_shared(): Promise<void> { return new Promise<void>(resolve => { let resolver: IResolver = { ...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/** * @inheritDoc */ public async try_lock_shared(): Promise<boolean> { if (this.writing_ !== 0) return false; ++this.reading_; this.queue_.push_back({ handler: null, accessType: AccessType.READ, lockType: LockType.KNOCK ...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/** * @inheritDoc */ public try_lock_shared_for(ms: number): Promise<boolean> { return new Promise<boolean>(resolve => { // CONSTRUCT RESOLVER WITH PREDICATION let resolver: IResolver = { handler: (this.writing_ === 0) ? null ...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/** * @inheritDoc */ public try_lock_shared_until(at: Date): Promise<boolean> { // COMPUTE MILLISECONDS TO WAIT let now: Date = new Date(); let ms: number = at.getTime() - now.getTime(); return this.try_lock_shared_for(ms); }
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/** * @inheritDoc */ public async unlock_shared(): Promise<void> { if (this._Current_access_type() !== AccessType.READ) throw new InvalidArgument(`Error on std.${this.source_.constructor.name}.unlock_shared(): this mutex is free on the shared lock.`); --this.reading_; ...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/* --------------------------------------------------------- RELEASE --------------------------------------------------------- */ /** * @hidden */ private _Release(): void { // STEP TO THE NEXT LOCKS let current: AccessType = this._Current_access_type()!; for (let reso...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
MethodDeclaration
/** * @hidden */ private _Cancel(it: List.Iterator<IResolver>): void { //---- // POP THE RELEASE //---- // DO RASE this.queue_.erase(it); // EXTRACT HANDLER TO AVOID THE `this._Release()` let handler: Function = it.value.handler!; it.value.h...
opencollective/tstl
src/thread/SharedTimedMutex.ts
TypeScript
FunctionDeclaration
function DrawerView(props: Props) { const [lock, setLock] = useState(false) const [visibleBgColor, setVisibleBgColor] = useState(false) // 延迟显示防止启动时闪烁 useEffect(() => { setTimeout(() => setVisibleBgColor(true), 700) }, []) drawerController = { setLock: (lock = true) => setLock(lock) ...
koharubiyori/Moegirl-RN
src/views/drawer/Index.tsx
TypeScript
ArrowFunction
() => { setTimeout(() => setVisibleBgColor(true), 700) }
koharubiyori/Moegirl-RN
src/views/drawer/Index.tsx
TypeScript
ArrowFunction
() => setVisibleBgColor(true)
koharubiyori/Moegirl-RN
src/views/drawer/Index.tsx
TypeScript
ArrowFunction
(lock = true) => setLock(lock)
koharubiyori/Moegirl-RN
src/views/drawer/Index.tsx
TypeScript
InterfaceDeclaration
export interface Props { children(): JSX.Element }
koharubiyori/Moegirl-RN
src/views/drawer/Index.tsx
TypeScript
InterfaceDeclaration
export interface DrawerController { setLock(lock?: boolean): void }
koharubiyori/Moegirl-RN
src/views/drawer/Index.tsx
TypeScript
ArrowFunction
() => { it('should display messgae', inject([], () => { const queue = new Subject<string>(); queue.first(s => s == 'hello').subscribe( console.log, console.log); queue.next('a'); queue.next('hello'); queue.error('oops'); queue.next('hello'); ...
serge-jacquemin-busi/pro-state
src/app/playground/playground.spec.ts
TypeScript
ArrowFunction
() => { const queue = new Subject<string>(); queue.first(s => s == 'hello').subscribe( console.log, console.log); queue.next('a'); queue.next('hello'); queue.error('oops'); queue.next('hello'); }
serge-jacquemin-busi/pro-state
src/app/playground/playground.spec.ts
TypeScript
ArrowFunction
s => s == 'hello'
serge-jacquemin-busi/pro-state
src/app/playground/playground.spec.ts
TypeScript
EnumDeclaration
export enum Floor { Normal, Pit }
HolyMeekrob/i-shove-you-so-much
src/model/floor.ts
TypeScript
FunctionDeclaration
function insertIntoSetTracker( tier: number, statMix: string, armorSet: IntermediateProcessArmorSet, setTracker: SetTracker ): void { if (setTracker.length === 0) { setTracker.push({ tier, statMixes: [{ statMix, armorSets: [armorSet] }] }); return; } for (let tierIndex = 0; tierIndex < setTracke...
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
FunctionDeclaration
/** * Gets the stat values of an item with masterwork. */ function getStatValuesWithMWProcess( item: ProcessItem, assumeMasterwork: boolean | null, orderedStatValues: number[] ) { const baseStats = { ...item.baseStats }; // Checking energy tells us if it is Armour 2.0 (it can have value 0) if (item.socke...
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
FunctionDeclaration
function flattenSets(sets: IntermediateProcessArmorSet[]): ProcessArmorSet[] { return sets.map((set) => ({ ...set, armor: set.armor.map((item) => item.id), })); }
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(statType) => statHashes[statType]
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(statType) => !statFilters[statType].ignored
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(i) => -i.baseStats[TOTAL_STAT_HASH]
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(l) => l[l.length - 1].baseStats[TOTAL_STAT_HASH]
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(item) => (item.equippingLabel ? 1 : 0)
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(set) => set.statMixes.map((mix) => mix.armorSets)
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(mix) => mix.armorSets
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(category) => category.categoryStyle === DestinySocketCategoryStyle.EnergyMeter
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(socket) => socket.plug?.plugItemHash ?? NaN
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(statHash) => Math.max(baseStats[statHash], 0)
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
(set) => ({ ...set, armor: set.armor.map((item) => item.id), })
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
TypeAliasDeclaration
type SetTracker = { tier: number; statMixes: { statMix: string; armorSets: IntermediateProcessArmorSet[] }[]; }[];
nomadjsdev/DIM
src/app/loadout-builder/processWorker/process.ts
TypeScript
ArrowFunction
dropDown => dropDown.label === label
MykolaGolubyev/react-component-viewer
src/components/viewer/dropdown/DropDowns.ts
TypeScript
ArrowFunction
dropDown => dropDown.labelKey === labelKey
MykolaGolubyev/react-component-viewer
src/components/viewer/dropdown/DropDowns.ts
TypeScript
ClassDeclaration
export class DropDowns { list: DropDown[]; constructor() { this.list = []; } add(label: string) { const dropDown = new DropDown(label); this.list.push(dropDown); return dropDown; } isEmpty() { return this.list.length === 0; } findDropDownByLa...
MykolaGolubyev/react-component-viewer
src/components/viewer/dropdown/DropDowns.ts
TypeScript
MethodDeclaration
add(label: string) { const dropDown = new DropDown(label); this.list.push(dropDown); return dropDown; }
MykolaGolubyev/react-component-viewer
src/components/viewer/dropdown/DropDowns.ts
TypeScript
MethodDeclaration
isEmpty() { return this.list.length === 0; }
MykolaGolubyev/react-component-viewer
src/components/viewer/dropdown/DropDowns.ts
TypeScript
MethodDeclaration
findDropDownByLabel(label: string) { return this.list.find(dropDown => dropDown.label === label); }
MykolaGolubyev/react-component-viewer
src/components/viewer/dropdown/DropDowns.ts
TypeScript
MethodDeclaration
findDropDownByLabelKey(labelKey: string) { return this.list.find(dropDown => dropDown.labelKey === labelKey); }
MykolaGolubyev/react-component-viewer
src/components/viewer/dropdown/DropDowns.ts
TypeScript
ArrowFunction
(image) => ({ path: image.filename, })
Gu7z/migueis-api
src/controllers/ProductsController.ts
TypeScript
ArrowFunction
(image) => image.path
Gu7z/migueis-api
src/controllers/ProductsController.ts
TypeScript
MethodDeclaration
async index(_req: Request, res: Response) { const productsRepository = getRepository(Products); const products = await productsRepository.find({ relations: ["images", "category"], }); return res.json(productView.renderMany(products)); }
Gu7z/migueis-api
src/controllers/ProductsController.ts
TypeScript
MethodDeclaration
async show(req: Request, res: Response) { const { id } = req.params; const productsRepository = getRepository(Products); const product = await productsRepository.findOneOrFail(id, { relations: ["images", "category"], }); return res.json(productView.render(product)); }
Gu7z/migueis-api
src/controllers/ProductsController.ts
TypeScript
MethodDeclaration
async create(req: Request, res: Response) { const { name, description, price, quantity, category: category_id, } = req.body; const productsRepository = getRepository(Products); const requestImages = req.files as Express.Multer.File[]; const images = requestImages.map...
Gu7z/migueis-api
src/controllers/ProductsController.ts
TypeScript
MethodDeclaration
async update(req: Request, res: Response) { const { id } = req.params; const { name, description, price, quantity, category: category_id, } = req.body; const productsRepository = getRepository(Products); const product = await productsRepository.findOneOrFail(id, { ...
Gu7z/migueis-api
src/controllers/ProductsController.ts
TypeScript
MethodDeclaration
async delete(req: Request, res: Response) { const { id } = req.params; const productsRepository = getRepository(Products); const product = await productsRepository.findOneOrFail(id, { relations: ["images"], }); const imagesNames = product.images.map((image) => image.path); deleteImages...
Gu7z/migueis-api
src/controllers/ProductsController.ts
TypeScript
ArrowFunction
(data: any[])=> { return { committees: data[1], tags: data[0] } }
tbtimes/zombie-campaigns-database
src/app/committee.service.ts
TypeScript
ClassDeclaration
@Injectable() export class CommitteeService { constructor(private http: HttpClient) { } getCommittees(): Observable<{committees: Committee[], tags: string[]}> { return forkJoin([ this.http.get("assets/all_tags.json"), this.http.get("assets/tags_by_comm.json") ]) .map((data: any[])=> { ...
tbtimes/zombie-campaigns-database
src/app/committee.service.ts
TypeScript
MethodDeclaration
getCommittees(): Observable<{committees: Committee[], tags: string[]}> { return forkJoin([ this.http.get("assets/all_tags.json"), this.http.get("assets/tags_by_comm.json") ]) .map((data: any[])=> { return { committees: data[1], tags: data[0] } }); }
tbtimes/zombie-campaigns-database
src/app/committee.service.ts
TypeScript
ArrowFunction
() => { const dispatch = useDispatch() // @ts-ignore const { project_id } = useParams() const project = useSelector<RootState, Project>( // eslint-disable-next-line eqeqeq (state) => state?.project?.data?.find((pro) => pro.id == project_id)! ) const dataSource = useSelector<RootState, SourceMapMod...
xunge0613/ohbug-web-app
src/pages/Settings/Project/SourceMap/SourceMap.tsx
TypeScript
ArrowFunction
// eslint-disable-next-line eqeqeq (state) => state?.project?.data?.find((pro) => pro.id == project_id)!
xunge0613/ohbug-web-app
src/pages/Settings/Project/SourceMap/SourceMap.tsx
TypeScript
ArrowFunction
(pro) => pro.id == project_id
xunge0613/ohbug-web-app
src/pages/Settings/Project/SourceMap/SourceMap.tsx
TypeScript
ArrowFunction
(state) => state.sourceMap?.data
xunge0613/ohbug-web-app
src/pages/Settings/Project/SourceMap/SourceMap.tsx
TypeScript
ArrowFunction
(state) => state.loading.effects['sourceMap/get']!
xunge0613/ohbug-web-app
src/pages/Settings/Project/SourceMap/SourceMap.tsx
TypeScript
ArrowFunction
() => { dispatch({ type: 'sourceMap/get', payload: { project }, }) }
xunge0613/ohbug-web-app
src/pages/Settings/Project/SourceMap/SourceMap.tsx
TypeScript
MethodDeclaration
dayjs(item?.createdAt)
xunge0613/ohbug-web-app
src/pages/Settings/Project/SourceMap/SourceMap.tsx
TypeScript
MethodDeclaration
onOk() { dispatch({ type: 'sourceMap/delete', payload: { sourceMap_id: item?.id, project, }, }) }
xunge0613/ohbug-web-app
src/pages/Settings/Project/SourceMap/SourceMap.tsx
TypeScript
FunctionDeclaration
export function test_MultiParserTemplate() { const xml = global.loadModule("xml-parser-tests/itemTemplates.xml") const view: any = builder.parse(xml); TKUnit.assertNotNull(view.items) TKUnit.assertEqual(view.items.length, 1); }
elektropay/NativeScript
tests/app/xml-parser-tests/xml-parser-tests.ts
TypeScript
ArrowFunction
eventData => { return { events: eventData.events.map(event => { return { title: event.title, content: event.content, id: event._id, imagePath: event.imagePath, startDate: event.startDate, ...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
event => { return { title: event.title, content: event.content, id: event._id, imagePath: event.imagePath, startDate: event.startDate, endDate: event.endDate, category: event.category, ...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
transformedEventData => { this.events = transformedEventData.events; this.eventsUpdated.next({ events: [...this.events], eventCount: transformedEventData.maxEvents }); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
(eventTBAdata) => { return eventTBAdata.eventTBA; }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
eventTBAdata => { this.eventTBA = eventTBAdata; this.eventTBAUpdated.next({ eventTBA: this.eventTBA }); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
eventData => { return { events: eventData.events.map(event => { return { title: event.title, content: event.content, id: event._id, imagePath: event.imagePath, startDate: event.startDate, ...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
event => { return { title: event.title, content: event.content, id: event._id, imagePath: event.imagePath, startDate: event.startDate, endDate: event.endDate, category: event.category, ...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
responseData => { this.router.navigate(['/']); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
response => { console.log(response); this.eventTBA.announcements.push({_id: response._id,announcement: msg.tba}); this.eventTBAUpdated.next({ eventTBA: this.eventTBA }) }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
response => { console.log(response.message); this.eventTBA.announcements[this.eventTBA.announcements.indexOf(eventTBAold)].announcement = eventnewTBA; this.eventTBAUpdated.next({ eventTBA: this.eventTBA }); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
response => { this.router.navigate(['/']); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
ArrowFunction
response => { console.log(response.message); this.eventTBA.announcements.splice(this.eventTBA.announcements.indexOf(eventTBA),1); this.eventTBAUpdated.next({ eventTBA: this.eventTBA }); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
getEvents(eventsPerPage: number, currentPage: number) { const queryParams = `?pagesize=${eventsPerPage}&page=${currentPage}`; this.http .get<{ message: string; events: any; maxEvents: number }>( BACKEND_URL + queryParams ) .pipe( map(eventData => { return { ...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
getEventUpdateListener() { return this.eventsUpdated.asObservable(); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
getEvent(id: string) { return this.http.get<{ _id: string; title: string; content: string; imagePath: string; startDate: string; endDate: string; category: string; creator: string; address: { street: string, city: string, state: string, ...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
addUserToEvent(data: any) { return this.http .post<{ accepted: boolean ,message: string }>( BACKEND_URL+ 'addusertoevent', data ); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
rejectInvitation(data: any) { return this.http .post<{ delete: boolean,message: string }>( BACKEND_URL+ 'rejectinvitation', data ); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
storeEventId(eventId: any) { this.dialogBoxEventId = eventId; }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
getEventId() { return this.dialogBoxEventId; }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
invite(email: any, eventId: String, from: String) { return this.http .post<{ message: string}>( BACKEND_URL + 'invitations', { email: email, eventId: eventId, from: from } ); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
getEventTBA(id:string) { this.http.get<{ message: string , eventTBA: EventTBA , }> (BACKEND_URL + 'tba/' + id) .pipe(map((eventTBAdata) => { return eventTBAdata.eventTBA; })) .subscribe(eventTBAdata => { this.eventTBA = eventTBAdata; this.eventTBAUpdated.next({ ...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
getEventTBAUpdateListener() { return this.eventTBAUpdated.asObservable(); }
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
getEventByCity(city: string) { const queryParams = `?city=${city}`; this.http .get<{ message: string; events: any; maxEvents: number }>( BACKEND_URL + 'city/' + queryParams ) .pipe( map(eventData => { return { events: eventData.events.map(event => { ...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
addEvent( title: string, content: string, image: File, startDate: string, endDate: string, category: string, is_private: Boolean, max_users: Number, eventFee: Number, eventManagerName: string, eventM...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
postTBA(msg: any, id:string){ this.http .post<{ message:string, _id: string }>( BACKEND_URL + 'tba/' + id, msg ).subscribe(response => { console.log(response); this.eventTBA.announcements.push({_id: response._id,announcement: msg.tba}); this.eventTBAUpdated.next({ even...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript
MethodDeclaration
updateEventTBA(eventTBAold: any, eventId: string,eventnewTBA: string ) { this.http.post<{message: string}>(BACKEND_URL + 'tba?eventId=' + eventId + '&eventTBAId=' + eventTBAold._id, {eventTBA: eventnewTBA} ) .subscribe(response => { console.log(response.message); this.eventTBA.announcemen...
sonusourav/instigo-webapp
src/app/events/events.service.ts
TypeScript