type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
() => {
simulateHashModule('sort', 'date ascending');
window.dispatchEvent(new Event('hashchange'));
expect(historyController.usageAnalytics.logSearchEvent).toHaveBeenCalledWith(analyticsActionCauseList.resultsSort, {
resultsSortBy: 'date ascending'
} as IAnalyticsRe... | ThibodeauJF/search-ui | unitTests/controllers/HistoryControllerTest.ts | TypeScript |
ArrowFunction |
() => {
historyController.queryStateModel.registerNewAttribute('f:@foo', []);
simulateHashModule('f:@foo', ['bar']);
window.dispatchEvent(new Event('hashchange'));
assertFacetAnalyticsCall(analyticsActionCauseList.facetSelect);
} | ThibodeauJF/search-ui | unitTests/controllers/HistoryControllerTest.ts | TypeScript |
ArrowFunction |
() => {
historyController.queryStateModel.registerNewAttribute('f:@foo', []);
simulateHashModule('f:@foo', ['bar']);
window.dispatchEvent(new Event('hashchange'));
simulateHashModule('f:@foo', []);
window.dispatchEvent(new Event('hashchange'));
assertFacetAna... | ThibodeauJF/search-ui | unitTests/controllers/HistoryControllerTest.ts | TypeScript |
ArrowFunction |
() => {
historyController.queryStateModel.registerNewAttribute('f:@foo:not', []);
simulateHashModule('f:@foo:not', ['bar']);
window.dispatchEvent(new Event('hashchange'));
assertFacetAnalyticsCall(analyticsActionCauseList.facetExclude);
} | ThibodeauJF/search-ui | unitTests/controllers/HistoryControllerTest.ts | TypeScript |
ArrowFunction |
() => {
historyController.queryStateModel.registerNewAttribute('f:@foo:not', []);
simulateHashModule('f:@foo:not', ['bar']);
window.dispatchEvent(new Event('hashchange'));
simulateHashModule('f:@foo:not', []);
window.dispatchEvent(new Event('hashchange'));
as... | ThibodeauJF/search-ui | unitTests/controllers/HistoryControllerTest.ts | TypeScript |
ArrowFunction |
() => {
new RegisterView();
} | muatassim/TypescriptFormsSamples | src/app/views/register.view.ts | TypeScript |
ClassDeclaration |
class RegisterView extends View {
constructor() {
super("Register", "btnRegister");
}
onButtonClick(): void {
let registerModel: RegisterModel =
new RegisterModel();
if (registerModel.validate("registerForm", "btnRegister")){
toastr.info(`${JSON.stringify(... | muatassim/TypescriptFormsSamples | src/app/views/register.view.ts | TypeScript |
MethodDeclaration |
onButtonClick(): void {
let registerModel: RegisterModel =
new RegisterModel();
if (registerModel.validate("registerForm", "btnRegister")){
toastr.info(`${JSON.stringify(registerModel)}`);
localStorage.setItem(registerModel.email, JSON.stringify(registerModel));
... | muatassim/TypescriptFormsSamples | src/app/views/register.view.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'kpn-leg-not-found-dialog',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<kpn-dialog>
<div mat-dialog-title i18n="@@leg-not-found-dialog.title">No path</div>
<div mat-dialog-content i18n="@@leg-not-found-dialog.message">
The planner did not find a pa... | sebicodes/knooppuntnet | client/src/app/components/ol/components/leg-not-found-dialog.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class MockWorkbenchEditorService {
open() {}
apply() {}
} | Amorites/core | packages/extension/__mocks__/workbencheditor.service.ts | TypeScript |
MethodDeclaration |
open() {} | Amorites/core | packages/extension/__mocks__/workbencheditor.service.ts | TypeScript |
MethodDeclaration |
apply() {} | Amorites/core | packages/extension/__mocks__/workbencheditor.service.ts | TypeScript |
FunctionDeclaration |
function HostMicrophoneButton(props: {
service: JDService
server?: AnalogSensorServer
visible: boolean
}) {
const { server, service, visible } = props
const enabledRegister = useRegister(service, SoundLevelReg.Enabled)
const minDecibelsRegister = useRegister(service, SoundLevelReg.MinDecibels)... | pelikhan/jacdac-docs | src/components/dashboard/DashboardSoundLevel.tsx | TypeScript |
FunctionDeclaration |
export default function DashboardSoundLevel(props: DashboardServiceProps) {
const { visible, service } = props
const soundLevelRegister = useRegister(service, SoundLevelReg.SoundLevel)
const [soundLevel] = useRegisterUnpackedValue<[number]>(
soundLevelRegister,
props
)
const server ... | pelikhan/jacdac-docs | src/components/dashboard/DashboardSoundLevel.tsx | TypeScript |
ArrowFunction |
async () => {
if (!enabled && server) await onClickActivateMicrophone()
await enabledRegister.sendSetBoolAsync(!enabled, true)
} | pelikhan/jacdac-docs | src/components/dashboard/DashboardSoundLevel.tsx | TypeScript |
ArrowFunction |
() =>
visible &&
server?.subscribe(REFRESH, () => {
const v = volume?.()
if (v !== undefined) {
server.reading.setValues([v])
}
}) | pelikhan/jacdac-docs | src/components/dashboard/DashboardSoundLevel.tsx | TypeScript |
ArrowFunction |
() => {
const v = volume?.()
if (v !== undefined) {
server.reading.setValues([v])
}
} | pelikhan/jacdac-docs | src/components/dashboard/DashboardSoundLevel.tsx | TypeScript |
FunctionDeclaration |
async function check() {
// @ts-ignore
await action.execute({ embeddable: child });
} | DyyDOS/kibana | x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts | TypeScript |
ArrowFunction |
() => {
const mock = jest.fn();
mock.mockReturnValue({ close: jest.fn() });
return mock;
} | DyyDOS/kibana | x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts | TypeScript |
ArrowFunction |
async (done) => {
const container = new TimeRangeContainer(
{
timeRange: { from: 'now-15m', to: 'now' },
panels: {
'1': {
type: TIME_RANGE_EMBEDDABLE,
explicitInput: {
id: '1',
},
},
'2': {
type: TIME_RANGE_EMBEDDABLE,
... | DyyDOS/kibana | x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts | TypeScript |
ArrowFunction |
() => {
expect(child1.getInput().timeRange).toEqual({ from: 'now-30days', to: 'now-29days' });
expect(child2.getInput().timeRange).toEqual({ from: 'now-30m', to: 'now-1m' });
subscription.unsubscribe();
done();
} | DyyDOS/kibana | x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts | TypeScript |
ArrowFunction |
async (done) => {
const container = new TimeRangeContainer(
{
timeRange: { from: 'now-15m', to: 'now' },
panels: {
'1': {
type: TIME_RANGE_EMBEDDABLE,
explicitInput: {
id: '1',
},
},
'2': {
type: TIME_RANGE_EMBEDDABLE,
... | DyyDOS/kibana | x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts | TypeScript |
ArrowFunction |
() => {
expect(child1.getInput().timeRange).toEqual({ from: 'now-10m', to: 'now-5m' });
expect(child2.getInput().timeRange).toEqual({ from: 'now-10m', to: 'now-5m' });
subscription.unsubscribe();
done();
} | DyyDOS/kibana | x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts | TypeScript |
ArrowFunction |
async (done) => {
const container = new TimeRangeContainer(
{
timeRange: { from: 'now-15m', to: 'now' },
panels: {
'1': {
type: TIME_RANGE_EMBEDDABLE,
explicitInput: {
id: '1',
timeRange: { to: '2', from: '1' },
},
},
'2': ... | DyyDOS/kibana | x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts | TypeScript |
ArrowFunction |
() => {
expect(child1.getInput().timeRange).toEqual({ from: '1', to: '2' });
expect(child2.getInput().timeRange).toEqual({ from: 'now-30m', to: 'now-1m' });
subscription.unsubscribe();
done();
} | DyyDOS/kibana | x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts | TypeScript |
ArrowFunction |
async () => {
const container = new TimeRangeContainer(
{
timeRange: { from: 'now-15m', to: 'now' },
panels: {
'1': {
type: TIME_RANGE_EMBEDDABLE,
explicitInput: {
id: '1',
},
},
},
id: '123',
},
(() => {}) as any
);
a... | DyyDOS/kibana | x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts | TypeScript |
ArrowFunction |
async () => {
const container = new HelloWorldContainer(
{
panels: {
'1': {
type: HELLO_WORLD_EMBEDDABLE,
explicitInput: {
id: '1',
},
},
},
id: '123',
},
(() => null) as any
);
await container.untilEmbeddableLoaded('1');
... | DyyDOS/kibana | x-pack/plugins/ui_actions_enhanced/public/custom_time_range_action.test.ts | TypeScript |
ClassDeclaration |
export default class ForEditor extends React.Component<IP, any> { } | mattco98/for-editor-dark | index.d.ts | TypeScript |
InterfaceDeclaration |
export interface IToolbar {
h1?: boolean;
h2?: boolean;
h3?: boolean;
h4?: boolean;
h5?: boolean;
h6?: boolean;
bold?: boolean;
italic?: boolean;
underline?: boolean;
strikethrough?: boolean;
img?: boolean;
link?: boolean;
code?: boolean;
preview?: boolean;
expand?: boolean;
undo?: bool... | mattco98/for-editor-dark | index.d.ts | TypeScript |
InterfaceDeclaration |
interface IP {
value?: string;
lineNum?: number;
onChange?: (value: string) => void;
onSave?: (value: string) => void;
placeholder?: string;
fontSize?: string;
disabled?: boolean;
style?: object;
height?: string;
preview?: boolean;
expand?: boolean;
subfield?: boolean;
toolbar?: IToolbar;
l... | mattco98/for-editor-dark | index.d.ts | TypeScript |
ClassDeclaration | //List all the functions
declare class AFLB {
sfw: {
baka():Promise<AFLB.AFLBRequestResults>;
angry():Promise<AFLB.AFLBRequestResults>;
bite():Promise<AFLB.AFLBRequestResults>;
bloodsuck():Promise<AFLB.AFLBRequestResults>;
blush():Promise<AFLB.AFLBRequestResults>;
bored():Promise... | AnimeFlame/aflb | typings/index.d.ts | TypeScript |
InterfaceDeclaration |
export interface AFLBRequestResults {
url: string;
} | AnimeFlame/aflb | typings/index.d.ts | TypeScript |
ArrowFunction |
(e: FocusEvent) => {
const target = e.currentTarget
const input =
target.querySelector('input') || target.querySelector('textarea')
return input?.value !== undefined && input.value !== ''
} | looker-open-source/lens | packages/components/src/Form/Fields/Field/useFloatingLabel.ts | TypeScript |
ArrowFunction |
(
nextFocusTarget: Element | Node | null,
inputArea: HTMLElement
) => {
const portalRoot = getPortalRoot()
if (!portalRoot.contains(nextFocusTarget)) {
return false
}
if (portalRoot.contains(inputArea)) {
return (
((nextFocusTarget as unknown) as Element)?.closest('portal-child') !==
in... | looker-open-source/lens | packages/components/src/Form/Fields/Field/useFloatingLabel.ts | TypeScript |
ArrowFunction |
<
Props extends {
value?: any
defaultValue?: any
} = CompatibleHTMLProps<HTMLInputElement>
>({
value,
defaultValue,
}: Pick<Props, 'value' | 'defaultValue'>) => {
if (value !== undefined) return value !== ''
if (defaultValue !== undefined) return defaultValue !== ''
return false
} | looker-open-source/lens | packages/components/src/Form/Fields/Field/useFloatingLabel.ts | TypeScript |
ArrowFunction |
({
checkValueOnBlur = defaultCheckValueOnBlur,
hasValue: propsHasValue,
labelOffset = '0rem',
}: UseFloatingLabelProps) => {
const [isFocused, setIsFocused] = useState(false)
const [hasValue, setHasValue] = useSyncedState(propsHasValue)
const theme = useContext(ThemeContext)
// Limitations of style/CSSP... | looker-open-source/lens | packages/components/src/Form/Fields/Field/useFloatingLabel.ts | TypeScript |
ArrowFunction |
(e: FocusEvent<HTMLDivElement>) => {
// Check for a value on blur – if there is one,
// the label shouldn't move back down
if (checkValueOnBlur) {
setHasValue(checkValueOnBlur(e))
}
const nextFocusTarget = getNextFocusTarget(e)
// For FieldSelect, focus can mo... | looker-open-source/lens | packages/components/src/Form/Fields/Field/useFloatingLabel.ts | TypeScript |
ArrowFunction |
() => {
setIsFocused(true)
} | looker-open-source/lens | packages/components/src/Form/Fields/Field/useFloatingLabel.ts | TypeScript |
ArrowFunction |
(value: unknown) =>
value === undefined ?
ok(value) :
fail(value, 'expected undefined') | preludejs/refute | src/undefined.ts | TypeScript |
ArrowFunction |
(operation: Types.Operations, action: CryptoGen.Actions) => {
if (operation) return false
logger.error(
`Crypto reducer: Action (${action.type}) did not contain operation ( "encrypt", "decrypt", "verify", "sign" )`
)
return true
} | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ArrowFunction |
(draftState, action) => {
const {operation} = action.payload
if (operationGuard(operation, action)) return
const op = draftState[operation]
op.bytesComplete = 0
op.bytesTotal = 0
op.inputType = 'text'
op.input = new HiddenString('')
op.output = new HiddenString('')
op.outputStatus... | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ArrowFunction |
(draftState, action) => {
const {operation} = action.payload
if (operationGuard(operation, action)) return
if (operation === Constants.Operations.Encrypt) {
const encrypt = draftState.encrypt
encrypt.bytesComplete = 0
encrypt.bytesTotal = 0
encrypt.recipients = initialState.encryp... | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ArrowFunction |
(draftState, action) => {
const {operation, recipients, hasSBS} = action.payload
if (operationGuard(operation, action)) return
if (operation !== Constants.Operations.Encrypt) return
const op = draftState.encrypt
// Output no longer valid since recipients have changed
op.outputValid = false
... | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ArrowFunction |
(draftState, action) => {
const {options: newOptions, hideIncludeSelf} = action.payload
const {encrypt} = draftState
const oldOptions = encrypt.options
encrypt.options = {
...oldOptions,
...newOptions,
}
// Output no longer valid since options have changed
encrypt.outputValid =... | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ArrowFunction |
(draftState, action) => {
const {operation, type, value} = action.payload
if (operationGuard(operation, action)) return
const op = draftState[operation]
const oldInput = op.input
// Reset input to 'text' when no value given (cleared input or removed file upload)
op.inputType = value.stringValu... | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ArrowFunction |
(draftState, action) => {
const {operation} = action.payload
const op = draftState[operation]
// For any file operation that completes, invalidate the output since multiple decrypt/verify operations will produce filenames with unqiue
// counters on the end (as to not overwrite any existing files in the... | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ArrowFunction |
(draftState, action) => {
const {
input,
operation,
output,
outputSigned,
outputSenderFullname,
outputSenderUsername,
outputType,
warning,
warningMessage,
} = action.payload
if (operationGuard(operation, action)) return
let inputAction:
| Cry... | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ArrowFunction |
(draftState, action) => {
const {operation, errorMessage} = action.payload
if (operationGuard(operation, action)) return
const op = draftState[operation]
// Clear output
op.output = new HiddenString('')
op.outputType = undefined
// Set error
op.outputStatus = 'error'
op.errorMessa... | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ArrowFunction |
(draftState, action) => {
const {bytesComplete, bytesTotal, operation} = action.payload
if (operationGuard(operation, action)) return
const op = draftState[operation]
// The final progress notification might come after saltpackDone.
// Reset progress when finsihed
if (bytesComplete === bytesTo... | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ArrowFunction |
(draftState: Container.Draft<Types.State>, action: TeamBuildingGen.Actions) => {
const val = editTeambuildingDraft('crypto', draftState.teamBuilding, action)
if (val !== undefined) {
draftState.teamBuilding = val
}
} | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
TypeAliasDeclaration |
type Actions = CryptoGen.Actions | TeamBuildingGen.Actions | N0tailOG/client | shared/reducers/crypto.tsx | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-fullmap',
templateUrl: './fullmap.component.html',
styleUrls: ['./fullmap.component.scss']
})
export class FullmapComponent implements OnInit {
myMarkers = [
{ id: 0, name: 'Canada', coords: { latitude: 56.130366, longitude: -106.346771 } },
{ id: 1, name: '... | ryansites310/youthstat-template | src/app/routes/pages/fullmap/fullmap.component.ts | TypeScript |
MethodDeclaration |
moveTo(coords) {
this.currLatitude = coords.latitude;
this.currLongitude = coords.longitude;
} | ryansites310/youthstat-template | src/app/routes/pages/fullmap/fullmap.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
} | ryansites310/youthstat-template | src/app/routes/pages/fullmap/fullmap.component.ts | TypeScript |
TypeAliasDeclaration | /** Add an element **`A`** at the beginning of **`T`**
* @param T to append to
* @param A to be added to
* @returns **`any[]`**
* @example
* ```ts
* ```
*/
export type Prepend<T extends any[], A extends any> =
((head: A, ...args: T) => any) extends ((...args: infer U) => any)
? U
: T | kimamula/ts-toolbelt | src/Tuple/Prepend.ts | TypeScript |
ArrowFunction |
({
children,
id: idOverride,
onBlur,
onChange,
onFocus,
validate,
parse,
format,
...props
}) => {
if (React.Children.count(children) !== 1) {
throw new Error(
'<ReferenceArrayInput> only accepts a single child (like <Datagrid>)'
);
}
const { ... | billyhotjava/react-admin | packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx | TypeScript |
ArrowFunction |
searchText => (searchText ? { q: searchText } : {}) | billyhotjava/react-admin | packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx | TypeScript |
ArrowFunction |
({
crudGetMany,
crudGetMatching,
filterToQuery,
perPage,
referenceSource,
...rest
}: any) => sanitizeInputRestProps(rest) | billyhotjava/react-admin | packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx | TypeScript |
ArrowFunction |
({
allowEmpty,
basePath,
children,
choices,
className,
error,
input,
loading,
isRequired,
label,
meta,
onChange,
options,
resource,
setFilter,
setPagination,
setSort,
source,
translate,
warning,
...rest
}: ReferenceArrayInputViewProps)... | billyhotjava/react-admin | packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx | TypeScript |
InterfaceDeclaration |
export interface ReferenceArrayInputProps extends InputProps {
allowEmpty?: boolean;
basePath?: string;
children: ReactElement;
classes?: any;
className?: string;
label?: string;
reference: string;
resource?: string;
[key: string]: any;
} | billyhotjava/react-admin | packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx | TypeScript |
InterfaceDeclaration |
export interface ReferenceArrayInputViewProps {
allowEmpty?: boolean;
basePath?: string;
children: ReactElement;
choices: any[];
classes?: object;
className?: string;
error?: string;
helperText?: string | boolean;
id: string;
input: FieldInputProps<any, HTMLElement>;
isRequi... | billyhotjava/react-admin | packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx | TypeScript |
ClassDeclaration |
@Component({
selector: 'hero-birthday',
pipes: [MultiNumber],
styles: [`
h3{
color:green;
}
`],
template: `
The hero's birthday is :
<div>{{ birthday }}</div>
<h3>with pipe | date:</h3>
<div>{{ birthday | date }}</div>
<h3>with pipe - long date:... | yishaiz/Angular2-Tour-of-Heroes | app/Pipes/hero-birthday.component.ts | TypeScript |
FunctionDeclaration |
function resetRegexes() {
ROUTER_REGEX.lastIndex = 0;
ROUTES_NO_MIDDLEWARES_REGEX.lastIndex = 0;
ROUTES_REGEX.lastIndex = 0;
MIDDLEWARES_REGEX.lastIndex = 0;
ROUTES_MIDDLEWARES_REGEX.lastIndex = 0;
PATH_PARAM_REGEX_SLASH.lastIndex = 0;
PATH_PARAM_REGEX_DO... | SchoolSquirrel/SchoolSquirrel | scripts/update-api-definitions.ts | TypeScript |
FunctionDeclaration |
function generateModelDefinitions() {
const entityDirectory = path.join(__dirname, "../api/src/entity");
const entityFiles = fs.readdirSync(entityDirectory);
const enums: {
[name: string]: string[];
} = {};
for (const entityFile of entityFiles) {
let content = getContent(... | SchoolSquirrel/SchoolSquirrel | scripts/update-api-definitions.ts | TypeScript |
FunctionDeclaration |
function getContent(entityFile: string) {
const entityPath = path.join(entityDirectory, entityFile);
let content = fs.readFileSync(entityPath).toString();
return content;
} | SchoolSquirrel/SchoolSquirrel | scripts/update-api-definitions.ts | TypeScript |
FunctionDeclaration |
function getClassName(result: RegExpExecArray) {
return result[1].indexOf(" ") ? result[1].split(" ").shift() : result[1];
} | SchoolSquirrel/SchoolSquirrel | scripts/update-api-definitions.ts | TypeScript |
ArrowFunction |
(p) => ({
in: "path",
name: p,
type: "ToDo",
required: true,
description: "ToDo",
}) | SchoolSquirrel/SchoolSquirrel | scripts/update-api-definitions.ts | TypeScript |
ArrowFunction |
(p) => p[1].required | SchoolSquirrel/SchoolSquirrel | scripts/update-api-definitions.ts | TypeScript |
ArrowFunction |
(p) => p[0] | SchoolSquirrel/SchoolSquirrel | scripts/update-api-definitions.ts | TypeScript |
FunctionDeclaration |
function _commonErrorHandler (err, reject) {
if (err.message.indexOf('query returned empty result') > 0) {
reject(new HttpError(err.message, 404))
} else {
reject(new Error(err.message))
}
} | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
FunctionDeclaration |
function _ssrHydrateSubcomponents (components, store, router, resolve, reject, app, context) {
Promise.all(components.map(SubComponent => {
if (SubComponent.asyncData) {
return SubComponent.asyncData({
store,
route: router.currentRoute,
context
})
} else {
return Pro... | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
SubComponent => {
if (SubComponent.asyncData) {
return SubComponent.asyncData({
store,
route: router.currentRoute,
context
})
} else {
return Promise.resolve(null)
}
} | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
() => {
if (buildTimeConfig.ssr.useInitialStateFilter) {
context.state = omit(store.state, store.state.config.ssr.initialStateFilter)
} else {
context.state = store.state
}
if (!buildTimeConfig.server.dynamicConfigReload) { // if dynamic config reload then we're sending config along with th... | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
err => {
_commonErrorHandler(err, reject)
} | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
context => {
return new Promise((resolve, reject) => {
const { app, router, store } = createApp(context, context.vs && context.vs.config ? context.vs.config : buildTimeConfig)
const meta = (app as any).$meta()
router.push(context.url)
context.meta = meta
router.onReady(() => {
context.outp... | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
const { app, router, store } = createApp(context, context.vs && context.vs.config ? context.vs.config : buildTimeConfig)
const meta = (app as any).$meta()
router.push(context.url)
context.meta = meta
router.onReady(() => {
context.output.cacheTags = new Set<string>()
... | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
() => {
context.output.cacheTags = new Set<string>()
if (store.state.config.storeViews.multistore === true) {
let storeCode = context.vs.storeCode // this is from http header or env variable
if (router.currentRoute) { // this is from url
storeCode = storeCodeFromRoute(router.curre... | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
(Component: any) => {
const components = Component.mixins ? Array.from(Component.mixins) : []
union(components, [Component]).map(SubComponent => {
if (SubComponent.preAsyncData) {
SubComponent.preAsyncData({ store, route: router.currentRoute })
}
})
if (C... | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
SubComponent => {
if (SubComponent.preAsyncData) {
SubComponent.preAsyncData({ store, route: router.currentRoute })
}
} | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
(result) => { // always execute the asyncData() from the top most component first
console.debug('Top-most asyncData executed')
_ssrHydrateSubcomponents(components, store, router, resolve, reject, app, context)
} | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
(err) => {
_commonErrorHandler(err, reject)
} | BartoszLiburski/vue-storefront | core/server-entry.ts | TypeScript |
ArrowFunction |
data => {
if (data.status === 200) {
this.cities = data["body"];
}
} | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
ArrowFunction |
() => {
this.imagePreview = reader.result;
} | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: "app-configurations",
templateUrl: "./configurations.component.html",
styleUrls: ["./configurations.component.scss", "../tabel.scss"]
})
export class ConfigurationsComponent implements OnInit, OnDestroy {
unit: string;
activities: string[] = ["شاليهات"];
// activities: string[] = ['ش... | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.configurationsForm = this.fg.group({
name: [""],
price: [""],
category: [""],
sub_category: [this.fg.array([])],
capacity: [""],
description: [""],
location: [""],
logo: [""],
email: [""],
images: [""],
panoramic_images: [""],
... | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
MethodDeclaration |
getCities() {
this.httpActivityService.getAllCities().subscribe(
data => {
if (data.status === 200) {
this.cities = data["body"];
}
},
err => {
console.log(err);
}
);
} | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
MethodDeclaration |
initFun() {
this.getCities();
} | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
MethodDeclaration |
onMapReady(map) {
this.mapConfigService.initDrawingManager(map);
} | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
MethodDeclaration |
selectMarker(event) {
this.locationValues = [event.coords.lng, event.coords.lat];
} | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
MethodDeclaration |
editConfigurationsData() {
this.configurationsForm.enable();
this.isEdit = true;
} | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
MethodDeclaration |
equals(objOne, objTwo) {
if (typeof objOne !== "undefined" && typeof objTwo !== "undefined") {
return objOne === objTwo;
}
} | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
MethodDeclaration |
onImagePicked(event: Event) {
const file = (event.target as HTMLInputElement).files[0];
if (!file) {
return;
}
const mimeType = file.type;
if (mimeType.match(/image\/*/) == null) {
return this.notificationService.errorNotification(
"This file is not supported, please upload imag... | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
MethodDeclaration |
onSubmit() {
const updateServiceWithNewImage = {
name: this.configurationsForm["controls"].brand_name.value,
description: this.configurationsForm["controls"].brand_desc.value,
categories: this.selectedCategories
};
console.log(updateServiceWithNewImage);
} | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
MethodDeclaration |
ngOnDestroy() {
// this.$destroy.next();
// this.$destroy.complete();
} | mohammed932/dalil-property-owner | src/app/modules/configurations/configurations.component.ts | TypeScript |
FunctionDeclaration |
export function getURLfromItem(
item: NativeDragItem,
filter: Function = (): boolean => true
): string {
let url = null;
if (item.urls) {
url = item.urls[0];
}
if (item.files) {
if (!filter(item.files[0].type)) {
return null;
}
url = item.files[0].path;
}
return url;
} | moonwave99/playa | src/renderer/hooks/useNativeDrop/useNativeDrop.ts | TypeScript |
FunctionDeclaration |
export default function useNativeDrop<T>({
onDrop,
accept = [NativeTypes.FILE, NativeTypes.URL],
filter = (): boolean => true
}: UseNativeDropParams): {
isOver: boolean;
canDrop: boolean;
drop: DragElementWrapper<T>;
} {
const [{ isOver, canDrop }, drop] = useDrop({
accept,
drop: (item: NativeDra... | moonwave99/playa | src/renderer/hooks/useNativeDrop/useNativeDrop.ts | TypeScript |
ArrowFunction |
(item: NativeDragItem) => onDrop(getURLfromItem(item, filter)) | moonwave99/playa | src/renderer/hooks/useNativeDrop/useNativeDrop.ts | TypeScript |
ArrowFunction |
monitor => ({
isOver: monitor.isOver(),
canDrop: monitor.canDrop()
}) | moonwave99/playa | src/renderer/hooks/useNativeDrop/useNativeDrop.ts | TypeScript |
InterfaceDeclaration |
export interface NativeDragItem extends DragObjectWithType {
urls?: string[];
files?: File[];
} | moonwave99/playa | src/renderer/hooks/useNativeDrop/useNativeDrop.ts | TypeScript |
TypeAliasDeclaration |
type UseNativeDropParams = {
onDrop: Function;
accept?: string[];
filter?: Function;
} | moonwave99/playa | src/renderer/hooks/useNativeDrop/useNativeDrop.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.