type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
/** @internal */ protected createAppearanceFromKey(key: number): FeatureSymbology.Appearance { let transparency: number | undefined; let rgb: RgbColor | undefined; if (key < 0) { transparency = Math.abs(key); } else { const color = ColorDef.fromJSON(key); rgb = RgbColor.fromCo...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get override key from color and override type */ public createOverrideKey(color: ColorDef, override: FeatureOverrideType): number | undefined { const colorValues = color.colors; switch (override) { case FeatureOverrideType.ColorAndAlpha: return 255 === colorValues.t ? undefined : color.tbg...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get color and override type for the given key. */ public getOverrideFromKey(key: number): { overrideType: FeatureOverrideType, color: ColorDef } { let overrideType; let color; if (key < 0) { color = ColorDef.from(0, 0, 0, 255 * Math.abs(key)); overrideType = FeatureOverrideType.AlphaO...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Create default appearance to use for emphasizeElements when not supplied by caller. */ public createDefaultAppearance(): FeatureSymbology.Appearance { return FeatureSymbology.Appearance.fromJSON({ rgb: new RgbColor(0xe4, 0xe4, 0xe4), transparency: 0.8, nonLocatable: true, }); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get the IDs of the currently never drawn elements. */ public getNeverDrawnElements(vp: Viewport): Id64Set | undefined { return (undefined !== vp.neverDrawn && 0 !== vp.neverDrawn.size ? vp.neverDrawn : undefined); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get the IDs of the currently always drawn elements. */ public getAlwaysDrawnElements(vp: Viewport): Id64Set | undefined { return (undefined !== vp.alwaysDrawn && 0 !== vp.alwaysDrawn.size ? vp.alwaysDrawn : undefined); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get the IDs of the currently hidden elements. */ public getHiddenElements(vp: Viewport): Id64Set | undefined { return this.getNeverDrawnElements(vp); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get the IDs of the currently isolated elements. */ public getIsolatedElements(vp: Viewport): Id64Set | undefined { return (vp.isAlwaysDrawnExclusive ? this.getAlwaysDrawnElements(vp) : undefined); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get the IDs of the currently emphasized isolated elements. */ public getEmphasizedIsolatedElements(): Id64Set | undefined { return (undefined !== this._defaultAppearance && undefined !== this._emphasizeIsolated && 0 !== this._emphasizeIsolated.size ? this._emphasizeIsolated : undefined); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get the IDs of the currently emphasized elements. */ public getEmphasizedElements(vp: Viewport): Id64Set | undefined { return (undefined !== this.getEmphasizedIsolatedElements() ? this._emphasizeIsolated : (undefined !== this._defaultAppearance && !vp.isAlwaysDrawnExclusive ? this.getAlwaysDrawnElements(vp) : undef...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get the map of current elements with color/transparency overrides. */ public getOverriddenElements(): Map<number, Id64Set> | undefined { return (undefined !== this._overrideAppearance && 0 !== this._overrideAppearance.size ? this._overrideAppearance : undefined); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get the IDs of current elements with the specified color/transparency override. */ public getOverriddenElementsByKey(key: number): Id64Set | undefined { return (undefined !== this._overrideAppearance ? this._overrideAppearance.get(key) : undefined); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Clear never drawn elements. * @return false if nothing to clear. */ public clearNeverDrawnElements(vp: Viewport): boolean { if (undefined === this.getNeverDrawnElements(vp)) return false; vp.clearNeverDrawn(); return true; }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Clear always drawn elements. * @return false if nothing to clear. */ public clearAlwaysDrawnElements(vp: Viewport): boolean { if (undefined === this.getAlwaysDrawnElements(vp)) return false; vp.clearAlwaysDrawn(); return true; }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Clear hidden elements. * @return false if nothing to clear. */ public clearHiddenElements(vp: Viewport): boolean { return this.clearNeverDrawnElements(vp); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Clear isolated elements. * @return false if nothing to clear. */ public clearIsolatedElements(vp: Viewport): boolean { if (undefined === this.getIsolatedElements(vp)) return false; if (this.clearEmphasizedIsolatedElements(vp, true)) return true; return this.clearAlwaysDrawnEleme...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Clear emphasized elements. * @return false if nothing to clear. */ public clearEmphasizedElements(vp: Viewport): boolean { if (undefined === this.getEmphasizedElements(vp)) return false; if (this.clearEmphasizedIsolatedElements(vp, false)) return true; if (!this.clearAlwaysDrawn...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Clear emphasized isolated elements. * @return false if nothing to clear. */ public clearEmphasizedIsolatedElements(vp: Viewport, setToAlwaysDrawn: boolean): boolean { const emphasizedIsolated = this.getEmphasizedIsolatedElements(); this._emphasizeIsolated = undefined; // Always clear in case defau...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Clear elements with color/transparency overrides. Specify key to clear only a single override. * @return false if nothing to clear. */ public clearOverriddenElements(vp: Viewport, key?: number): boolean { if (undefined === this._overrideAppearance) return false; if (undefined !== key) { ...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** @internal */ protected updateIdSet(ids: Id64Arg, replace: boolean, existingIds?: Id64Set): Id64Set | undefined { const newIds = new Set<string>(); Id64.toIdSet(ids).forEach((id) => { newIds.add(id); }); if (0 === newIds.size) return undefined; const oldSize = (!replace && undefined !== ex...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Set the element IDs to be never drawn. * @param ids The IDs of the elements to never draw. * @param vp The viewport. * @param replace true to replace currently hidden elements (if any) or false to add to the existing set. * @return true if overrides were changed. * @see [[Viewport.neverDrawn]] ...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Set the element IDs to be always drawn. * @param ids The IDs of the elements to always draw. * @param vp The viewport. * @param exclusive If true, *only* the specified elements will be drawn. * @param replace true to replace currently always drawn elements (if any) or false to add to the existing se...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Set the element IDs to be never drawn. * @param ids The IDs of the elements to never draw. * @param vp The viewport. * @param replace true to replace currently hidden elements (if any) or false to add to the existing set. * @return true if overrides were changed. * @see [[Viewport.neverDrawn]] ...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Set the currently selected elements to be never drawn. * @param vp The viewport. * @param replace true to replace currently hidden elements (if any) or false to add to the existing set. * @param clearSelection true to clear current selection after setting appearance override, false to leave selected. ...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Set the element IDs to be always drawn exclusively. * @param ids The IDs of the elements to always draw. * @param vp The viewport. * @param replace true to replace currently isolated elements (if any) or false to add to the existing set. * @return true if overrides were changed. * @see [[Viewpor...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Set the currently selected elements to be always drawn exclusively. * @param vp The viewport. * @param replace true to replace currently isolated elements (if any) or false to add to the existing set. * @param clearSelection true to clear current selection after setting appearance override, false to lea...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Set the element IDs to be always drawn normally with all other elements in the view overridden to draw using a default appearance.. * @param ids The IDs of the elements to always draw. * @param vp The viewport. * @param defaultAppearance Optional default appearance, uses non-locatable transparent grey i...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Set the currently selected elements to be always drawn normally with all other elements in the view overridden to draw using a default appearance. * @param vp The viewport. * @param defaultAppearance Optional default appearance, uses transparent grey if not specified. * @param replace true to replace cu...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Set the element IDs to display with a color/transparency override. * @param ids The IDs of the elements. * @param vp The viewport. * @param color ColorDef to specify override rgb and alpha. * @param override Whether to use color and alpha, only color, or only alpha from the supplied ColorDef. * ...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Set the currently selected elements to display with a color/transparency override. * @param vp The viewport. * @param color ColorDef to specify override rgb and alpha. * @param override Whether to use color and alpha, only color, or only alpha from the supplied ColorDef. * @param replace true to rep...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** @return true if provider is currently overriding the display of any elements. */ public isActive(vp: Viewport): boolean { return (undefined !== this.getNeverDrawnElements(vp) || undefined !== this.getAlwaysDrawnElements(vp) || undefined !== this.getOverriddenElements()); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Serialize to JSON representation. * @see [[EmphasizeElements.fromJSON]] */ public toJSON(vp: Viewport): EmphasizeElementsProps { const props: EmphasizeElementsProps = {}; const neverDrawn = this.getNeverDrawnElements(vp); if (undefined !== neverDrawn) props.neverDrawn = [...neverDrawn]...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Initialize from JSON representation. * @see [[EmphasizeElements.toJSON]] */ public fromJSON(props: EmphasizeElementsProps, vp: Viewport): boolean { let changed = false; if (undefined !== props.neverDrawn && this.setNeverDrawnElements(new Set<string>(props.neverDrawn), vp, true)) changed = t...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get current [[Viewport.featureOverrideProvider]] if it's an instance of EmphasizeElements. */ public static get(vp: Viewport): EmphasizeElements | undefined { return (vp.featureOverrideProvider instanceof EmphasizeElements ? vp.featureOverrideProvider : undefined); }
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Get or replace current [[Viewport.featureOverrideProvider]] with an instance of EmphasizeElements. */ public static getOrCreate(vp: Viewport): EmphasizeElements { let provider = vp.featureOverrideProvider instanceof EmphasizeElements ? vp.featureOverrideProvider : undefined; if (undefined === provider) { ...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
MethodDeclaration
/** Clear current [[Viewport.featureOverrideProvider]] if it's an instance of EmphasizeElements. */ public static clear(vp: Viewport, inactiveOnly: boolean = false) { const provider = vp.featureOverrideProvider instanceof EmphasizeElements ? vp.featureOverrideProvider : undefined; if (undefined === provider |...
rssahai/imodeljs
core/frontend/src/EmphasizeElements.ts
TypeScript
ArrowFunction
RpcMethod => { pluginManager.addRpcMethod(() => new RpcMethod(pluginManager)) }
hextraza/jbrowse-components
packages/core/CorePlugin.ts
TypeScript
ArrowFunction
() => new RpcMethod(pluginManager)
hextraza/jbrowse-components
packages/core/CorePlugin.ts
TypeScript
ArrowFunction
() => new AdapterType({ name: 'CytobandAdapter', configSchema: cytobandConfigSchema, AdapterClass: DataAdapter, })
hextraza/jbrowse-components
packages/core/CorePlugin.ts
TypeScript
ArrowFunction
() => { return new WidgetType({ name: 'BaseFeatureWidget', heading: 'Feature details', configSchema, stateModel: stateModelFactory(pluginManager), ReactComponent: lazy( () => import('./BaseFeatureWidget/BaseFeatureDetail'), ), }) }
hextraza/jbrowse-components
packages/core/CorePlugin.ts
TypeScript
ArrowFunction
() => import('./BaseFeatureWidget/BaseFeatureDetail')
hextraza/jbrowse-components
packages/core/CorePlugin.ts
TypeScript
ClassDeclaration
// the core plugin, which registers types that ALL JBrowse applications are // expected to need. export default class CorePlugin extends Plugin { name = 'CorePlugin' install(pluginManager: PluginManager) { // register all our core rpc methods Object.values(coreRpcMethods).forEach(RpcMethod => { plugi...
hextraza/jbrowse-components
packages/core/CorePlugin.ts
TypeScript
MethodDeclaration
install(pluginManager: PluginManager) { // register all our core rpc methods Object.values(coreRpcMethods).forEach(RpcMethod => { pluginManager.addRpcMethod(() => new RpcMethod(pluginManager)) }) pluginManager.addAdapterType( () => new AdapterType({ name: 'CytobandAdapter...
hextraza/jbrowse-components
packages/core/CorePlugin.ts
TypeScript
ArrowFunction
() => { analyticsWebClientMock = { sendUIEvent: jest.fn(), sendOperationalEvent: jest.fn(), sendTrackEvent: jest.fn(), sendScreenEvent: jest.fn(), }; loggerMock = createLoggerMock(); }
pioug/atlassian-frontend-mirror
analytics/analytics-listeners/src/__tests__/unit/navigation/NavigationListenerSpec.tsx
TypeScript
ArrowFunction
() => { const component = mount( <NavigationListener client={analyticsWebClientMock} logger={loggerMock}> <div /> </NavigationListener>, ); const analyticsListener = component.find(AnalyticsListener); expect(analyticsListener.props()).toHaveProperty('channel', 'navigation'); }
pioug/atlassian-frontend-mirror
analytics/analytics-listeners/src/__tests__/unit/navigation/NavigationListenerSpec.tsx
TypeScript
ArrowFunction
( { eventPayload, clientPayload, eventType = UI_EVENT_TYPE, context = [], }: CaseArgs, done: Function, ) => { const spy = jest.fn(); const ButtonWithAnalytics = createButtonWithAnalytics( eventPayload, FabricChannel.navigation, ); ...
pioug/atlassian-frontend-mirror
analytics/analytics-listeners/src/__tests__/unit/navigation/NavigationListenerSpec.tsx
TypeScript
ArrowFunction
() => { expect((mockFn as any).mock.calls[0][0]).toMatchObject(clientPayload); done(); }
pioug/atlassian-frontend-mirror
analytics/analytics-listeners/src/__tests__/unit/navigation/NavigationListenerSpec.tsx
TypeScript
TypeAliasDeclaration
type CaseArgs = { name: string; eventPayload: GasPurePayload; clientPayload: GasPurePayload; eventType?: string; context: any[]; };
pioug/atlassian-frontend-mirror
analytics/analytics-listeners/src/__tests__/unit/navigation/NavigationListenerSpec.tsx
TypeScript
ClassDeclaration
@Component({ selector: 'app-rfq', templateUrl: './rfq.component.html', styleUrls: ['./rfq.component.less'] }) export class RfqComponent implements OnInit { constructor() { } ngOnInit() { } }
gangadhar-rt/POTUI
src/app/secure/procurement/precontract/rfq/rfq.component.ts
TypeScript
ArrowFunction
_type => Course_attendance_logUpdateInput
ayushpandey8439/backend
graphql/generated/resolvers/crud/Course_attendance_log/args/UpdateCourse_attendance_logArgs.ts
TypeScript
ArrowFunction
_type => Course_attendance_logWhereUniqueInput
ayushpandey8439/backend
graphql/generated/resolvers/crud/Course_attendance_log/args/UpdateCourse_attendance_logArgs.ts
TypeScript
ClassDeclaration
@TypeGraphQL.ArgsType() export class UpdateCourse_attendance_logArgs { @TypeGraphQL.Field(_type => Course_attendance_logUpdateInput, { nullable: false }) data!: Course_attendance_logUpdateInput; @TypeGraphQL.Field(_type => Course_attendance_logWhereUniqueInput, { nullable: false }) where!: Course_...
ayushpandey8439/backend
graphql/generated/resolvers/crud/Course_attendance_log/args/UpdateCourse_attendance_logArgs.ts
TypeScript
FunctionDeclaration
function wrapNativeAccount( pubkey: StringPublicKey, account?: AccountInfo<Buffer>, ): TokenAccount | undefined { if (!account) { return undefined; } const key = new PublicKey(pubkey); return { pubkey: pubkey, account, info: { address: key, mint: WRAPPED_SOL_MINT, owner:...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
FunctionDeclaration
export function AccountsProvider({ children = null as any }) { const connection = useConnection(); const { publicKey } = useWallet(); const [tokenAccounts, setTokenAccounts] = useState<TokenAccount[]>([]); const [userAccounts, setUserAccounts] = useState<TokenAccount[]>([]); const { nativeAccount } = UseNati...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
FunctionDeclaration
export function useNativeAccount() { const context = useContext(AccountsContext); return { account: context.nativeAccount as AccountInfo<Buffer>, }; }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
FunctionDeclaration
export function useMint(key?: string | PublicKey) { const connection = useConnection(); const [mint, setMint] = useState<MintInfo>(); const id = typeof key === 'string' ? key : key?.toBase58(); useEffect(() => { if (!id) { return; } cache .query(connection, id, MintParser) .the...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
FunctionDeclaration
export function useAccount(pubKey?: PublicKey) { const connection = useConnection(); const [account, setAccount] = useState<TokenAccount>(); const key = pubKey?.toBase58(); useEffect(() => { const query = async () => { try { if (!key) { return; } const acc = await ...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { const context = useContext(AccountsContext); return context; }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { const connection = useConnection(); const { publicKey } = useWallet(); const [nativeAccount, setNativeAccount] = useState<AccountInfo<Buffer>>(); const updateCache = useCallback( account => { if (publicKey) { const wrapped = wrapNativeAccount(publicKey.toBase58(), account); ...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
account => { if (publicKey) { const wrapped = wrapNativeAccount(publicKey.toBase58(), account); if (wrapped !== undefined) { const id = publicKey.toBase58(); cache.registerParser(id, TokenAccountParser); genericCache.set(id, wrapped as TokenAccount); cache....
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { let subId = 0; const updateAccount = (account: AccountInfo<Buffer> | null) => { if (account) { updateCache(account); setNativeAccount(account); } }; (async () => { if (!connection || !publicKey) { return; } const subDone = timeStart( ...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
(account: AccountInfo<Buffer> | null) => { if (account) { updateCache(account); setNativeAccount(account); } }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
async () => { if (!connection || !publicKey) { return; } const subDone = timeStart( 'UseNativeAccount#sub$connection.onAccountChange', ); subId = connection.onAccountChange(publicKey, info => { subDone(); updateAccount(info); }); const done = ...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
info => { subDone(); updateAccount(info); }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { if (subId) { connection.removeAccountChangeListener(subId); } }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
async ( connection: Connection, owner?: PublicKey, ) => { if (!owner) { return; } // used for filtering account updates over websocket PRECACHED_OWNERS.add(owner.toBase58()); // user accounts are updated via ws subscription const accounts = await connection.getTokenAccountsByOwner(owner, { pr...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
info => { cache.add(info.pubkey.toBase58(), info.account, TokenAccountParser); }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { return cache .byParser(TokenAccountParser) .map(id => cache.get(id)) .filter(a => a && a.info.owner.toBase58() === walletKey) .map(a => a as TokenAccount); }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
id => cache.get(id)
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
a => a && a.info.owner.toBase58() === walletKey
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
a => a as TokenAccount
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { const accounts = selectUserAccounts().filter( a => a !== undefined, ) as TokenAccount[]; setUserAccounts(accounts); }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
a => a !== undefined
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { const subs: number[] = []; cache.emitter.onCache(args => { if (args.isNew && args.isActive) { let id = args.id; let deserialize = args.parser; connection.onAccountChange(new PublicKey(id), info => { cache.add(id, info, deserialize); }); } }); ...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
args => { if (args.isNew && args.isActive) { let id = args.id; let deserialize = args.parser; connection.onAccountChange(new PublicKey(id), info => { cache.add(id, info, deserialize); }); } }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
info => { cache.add(id, info, deserialize); }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { subs.forEach(id => connection.removeAccountChangeListener(id)); }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
id => connection.removeAccountChangeListener(id)
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { if (!connection || !publicKey) { setTokenAccounts([]); } else { precacheUserTokenAccounts(connection, publicKey).then(() => { setTokenAccounts(selectUserAccounts()); }); // This can return different types of accounts: token-account, mint, multisig // TODO: web3.js...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { setTokenAccounts(selectUserAccounts()); }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
info => { // TODO: fix type in web3.js const id = info.accountId as unknown as string; // TODO: do we need a better way to identify layout (maybe a enum identifing type?) if (info.accountInfo.data.length === AccountLayout.span) { const data = deserializeAccount(info....
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { connection.removeProgramAccountChangeListener(tokenSubID); }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { if (!id) { return; } cache .query(connection, id, MintParser) .then(acc => setMint(acc.info as any)) .catch(err => console.log(err)); const dispose = cache.emitter.onCache(e => { const event = e; if (event.id === id) { cache .query(connect...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
acc => setMint(acc.info as any)
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
e => { const event = e; if (event.id === id) { cache .query(connection, id, MintParser) .then(mint => setMint(mint.info as any)); } }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
mint => setMint(mint.info as any)
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { dispose(); }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
() => { const query = async () => { try { if (!key) { return; } const acc = await cache .query(connection, key, TokenAccountParser) .catch(err => console.log(err)); if (acc) { setAccount(acc); } } catch (err) { con...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
async () => { try { if (!key) { return; } const acc = await cache .query(connection, key, TokenAccountParser) .catch(err => console.log(err)); if (acc) { setAccount(acc); } } catch (err) { console.error(err); } ...
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ArrowFunction
e => { const event = e; if (event.id === key) { query(); } }
ATavanaei/metaplex
js/packages/common/src/contexts/accounts/accounts.tsx
TypeScript
ClassDeclaration
/** * An event generated by a participant interacting with the LAMP app. */ export class SensorEvent { /** * */ timestamp?: Timestamp /** * The type of the sensor event. */ sensor?: string /** * The item information recorded within the sensor event. */ ...
BIDMCDigitalPsychiatry/LAMP-js
src/model/SensorEvent.ts
TypeScript
ArrowFunction
(endpointConfig: ApiDataEndpointConfig, request: ApiDataRequest): boolean => Date.now() - request.lastCall > (typeof endpointConfig.cacheDuration === 'number' ? endpointConfig.cacheDuration : Number.POSITIVE_INFINITY)
RikSchefferOberon/react-api-data
src/selectors/cacheExpired.ts
TypeScript
ArrowFunction
() => ({ createPlayer: jest.fn(), })
openfun/marsha
src/frontend/components/PublicVideoDashboard/index.spec.tsx
TypeScript
ArrowFunction
() => ({ getResource: jest.fn().mockResolvedValue(null), })
openfun/marsha
src/frontend/components/PublicVideoDashboard/index.spec.tsx
TypeScript
ArrowFunction
() => ({ pollForLive: jest.fn().mockResolvedValue(null), })
openfun/marsha
src/frontend/components/PublicVideoDashboard/index.spec.tsx
TypeScript
ArrowFunction
() => ({ appData: { video: mockVideo, }, getDecodedJwt: () => ({ permissions: { can_update: mockCanUpdate, }, }), })
openfun/marsha
src/frontend/components/PublicVideoDashboard/index.spec.tsx
TypeScript
ArrowFunction
() => ({ permissions: { can_update: mockCanUpdate, }, })
openfun/marsha
src/frontend/components/PublicVideoDashboard/index.spec.tsx
TypeScript
ArrowFunction
() => ({ converseMounter: jest.fn(() => jest.fn()), })
openfun/marsha
src/frontend/components/PublicVideoDashboard/index.spec.tsx
TypeScript
ArrowFunction
() => jest.fn()
openfun/marsha
src/frontend/components/PublicVideoDashboard/index.spec.tsx
TypeScript
ArrowFunction
() => { fetchMock.mock( '/api/timedtexttracks/', { actions: { POST: { language: { choices: [ { display_name: 'English', value: 'en' }, { display_name: 'French', value: 'fr' }, ], }, }, ...
openfun/marsha
src/frontend/components/PublicVideoDashboard/index.spec.tsx
TypeScript