Skip to content

Instantly share code, notes, and snippets.

View JayBee007's full-sized avatar

Javed JayBee007

  • Moscow
View GitHub Profile
@sibelius
sibelius / AutocompleteRelay.tsx
Last active March 23, 2024 10:13
@material-ui Autocomplete lab with react-window + infinite-loader for GraphQL/Relay connections
import React, { useRef, useState } from 'react';
import { Typography } from '@material-ui/core';
import TextField from '@material-ui/core/TextField';
import CircularProgress from '@material-ui/core/CircularProgress';
import Autocomplete, {
AutocompleteChangeDetails,
AutocompleteChangeReason,
AutocompleteProps
} from '@material-ui/lab/Autocomplete';
@sicruse
sicruse / messages.hooks.js
Created May 15, 2017 22:41
Example use of feathers-sequelize object hydration
const hydrate = require('feathers-sequelize/hooks/hydrate');
function includePoster() {
return function (hook) {
const model = hook.app.service('users').Model;
const association = { include: [{ model: model, as: 'poster', attributes: ['userId', 'displayName', 'avatar'] }] };
switch (hook.type) {
case 'before':
hook.params.sequelize = Object.assign(association, { raw: false });