repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
haalto/mop-twitter-pipeline
services/mq-worker/src/services/tweetServices.ts
import { getSession } from "../neo4j"; import { StreamObject } from "../types"; export const createTweet = async (streamObject: StreamObject) => { const session = getSession(); const { id, created_at, text, author_id } = streamObject.data; const tweet = { id, created_at, text, author_id, }; t...
haalto/mop-twitter-pipeline
services/api/src/index.ts
<filename>services/api/src/index.ts import { createServer } from "./server"; import { config } from "./config"; (async () => { const { port } = config; try { (await createServer()).listen(port, () => { console.log(`🚀 Server ready`); }); } catch (err) { console.log(err); process.exit(1); ...
haalto/mop-twitter-pipeline
services/api/src/schemas/Tweet.ts
<filename>services/api/src/schemas/Tweet.ts import { Field, ObjectType } from "type-graphql"; import User from "./User"; @ObjectType() export default class Tweet { @Field(() => String) id: String; @Field(() => String) author_id: String; @Field(() => String) text: String; @Field(() => String) created...
haalto/mop-twitter-pipeline
services/api/src/resolvers/UserResolver.ts
<gh_stars>0 import { Arg, Query, Resolver } from "type-graphql"; import User from "../schemas/User"; import { getUser, getUsers } from "../services/userServices"; @Resolver(User) export default class { @Query(() => [User]) async users() { const users = await getUsers(); return users; } @Query(() => Us...
haalto/mop-twitter-pipeline
services/client/src/schemas/tweets.ts
import { gql } from "@apollo/client"; export const GET_TWEETS_WITH_USERS = gql` query Query { tweetsWithUsers { id author_id text created_at user { id name username } } } `;
haalto/mop-twitter-pipeline
services/database/index.ts
<reponame>haalto/mop-twitter-pipeline<filename>services/database/index.ts import { Args } from "./types"; import { createMigration, runLatestMigration, } from "./services/migrationService"; (async () => { const args = process.argv; switch (args[2]) { case Args.LATEST: await runLatestMigration(); ...
haalto/mop-twitter-pipeline
services/api/src/services/userServices.ts
import { createQuery } from "../helpers"; export const getUsers = async () => { const result = await createQuery("MATCH (u:User) RETURN u"); return result.map((record) => record.get("u").properties); }; export const getUser = async (id: string) => { const result = await createQuery("MATCH (u:User) WHERE u.id = ...
haalto/mop-twitter-pipeline
services/client/src/views/Dashboard.tsx
import { useUsers } from "../hooks/useUsers"; import { SigmaContainer } from "react-sigma-v2"; import "react-sigma-v2/lib/react-sigma-v2.css"; import { DataGraph } from "../components/Graph"; import { useTweets } from "../hooks/useTweets"; export const Dashboard = () => { //const { loading, data, error } = useUsers(...
haalto/mop-twitter-pipeline
services/database/config.ts
export const config = { dbUrl: process.env.DB_URL || "bolt://localhost:7687", };
haalto/mop-twitter-pipeline
services/client/src/hooks/useUsers.ts
<reponame>haalto/mop-twitter-pipeline<gh_stars>0 import { useQuery } from "@apollo/client"; import { GET_USERS } from "../schemas/users"; export const useUsers = () => { const { loading, error, data } = useQuery(GET_USERS); return { loading, error, data: data?.users ?? [] }; };
haalto/mop-twitter-pipeline
services/stream-handler/tests/unit.test.ts
import { generateRulePayload, generateValueForRuleToFollowTweetsFromUser, } from "../src/services/rules"; import { generateRandomStrings } from "./helpers"; describe("generate rules", () => { it("generates value for a Twitter Stream rule from a list of user ids", () => { const ids = ["foo", "bar", "baz"]; ...
haalto/mop-twitter-pipeline
services/stream-handler/src/services/stream.ts
import { get } from "needle"; import { config } from "../config"; import { isJSONString } from "../helpers"; import { sendToQueue } from "./mq"; const { streamURL, bearerToken } = config; export const streamConnect = (retryAttempt: number) => { const stream = get(streamURL, { headers: { "User-Agent": "par...
haalto/mop-twitter-pipeline
services/api/src/services/tweetServices.ts
<filename>services/api/src/services/tweetServices.ts<gh_stars>0 import { createQuery } from "../helpers"; export const getTweetsWithUsers = async () => { const result = await createQuery( "MATCH (u:User)-[r:TWEETED]->(t:Tweet) RETURN u,r,t" ); return result.map((record) => ({ ...record.get("t").propertie...
haalto/mop-twitter-pipeline
services/stream-handler/src/services/rules.ts
import axios from "axios"; import { config } from "../config"; import { GetRulesResponse, PostRulesRequestPayload } from "../types"; import { getUsersOfList } from "./lists"; import { splitEvery } from "ramda"; const { rulesURL, bearerToken } = config; export const getAllRules = async (): Promise<GetRulesResponse> =>...
haalto/mop-twitter-pipeline
services/client/src/App.tsx
import { ApolloClient, InMemoryCache, ApolloProvider } from "@apollo/client"; import { Dashboard } from "./views/Dashboard"; const client = new ApolloClient({ uri: "http://localhost:5000/graphql", cache: new InMemoryCache(), }); function App() { return ( <> <Dashboard /> </> ); } export default...
haalto/mop-twitter-pipeline
services/client/src/schemas/users.ts
<reponame>haalto/mop-twitter-pipeline<filename>services/client/src/schemas/users.ts import { gql } from "@apollo/client"; export const GET_USERS = gql` query Query { users { id name username } } `;
haalto/mop-twitter-pipeline
services/stream-handler/src/services/userServices.ts
<filename>services/stream-handler/src/services/userServices.ts import { getSession } from "../neo4j"; import { User } from "../types"; export const createUsersBatch = (users: User[]) => { const session = getSession(); session.writeTransaction(async (tx) => { try { await Promise.all( users.map( ...
haalto/mop-twitter-pipeline
services/database/services/migrationService.ts
import { writeFileSync, readdirSync, readFileSync } from "fs"; import { getSession } from "./neo4j"; const fileExtensions = ["cypher"]; const readLatestFilename = (path: string) => { const files = readdirSync(path); const cypherFiles = files.filter((file) => fileExtensions.includes(file.split(".").at(-1) ?? "...
haalto/mop-twitter-pipeline
services/stream-handler/tests/helpers.ts
<gh_stars>0 import { times } from "ramda"; export const generateRandomStrings = (amount: number) => { return times(() => (Math.random() * 21).toString().replace(".", ""), amount); };
haalto/mop-twitter-pipeline
services/stream-handler/src/config.ts
<filename>services/stream-handler/src/config.ts import * as dotenv from "dotenv"; import { stringify } from "querystring"; dotenv.config({ path: `${__dirname}/../.env` }); export const params = { expansions: "author_id", "tweet.fields": "created_at,entities,context_annotations,text,geo", }; const streamURL = `htt...
haalto/mop-twitter-pipeline
services/stream-handler/src/types.ts
<reponame>haalto/mop-twitter-pipeline<filename>services/stream-handler/src/types.ts export type Rule = { id: string; value: string; tag: string; }; export type GetRulesResponse = { data: Rule[]; meta: { sent: string; result_count: number; }; }; export type PostRulesRequestPayload = { add: NewRul...
haalto/mop-twitter-pipeline
services/api/src/server.ts
<gh_stars>0 import "reflect-metadata"; import { buildSchema } from "type-graphql"; import { ApolloServer } from "apollo-server-express"; import * as express from "express"; import UserResolver from "./resolvers/UserResolver"; import TweetResolver from "./resolvers/TweetResolver"; export const createServer = async () =...
haalto/mop-twitter-pipeline
services/database/enums.ts
export enum Args { LATEST = "latest", CREATE = "create", }
haalto/mop-twitter-pipeline
services/mq-worker/src/types.ts
export interface Mention { start: number; end: number; username: string; id: string; } export interface Entities { mentions: Mention[]; } export interface Tweet { author_id: string; created_at: Date; entities: Entities; id: string; text: string; } export interface User { id: string; name: str...
haalto/mop-twitter-pipeline
services/stream-handler/src/neo4j.ts
<reponame>haalto/mop-twitter-pipeline import { config } from "./config"; import neo4j from "neo4j-driver"; const driver = neo4j.driver(config.dbUrl); export const getSession = () => driver.session();
haalto/mop-twitter-pipeline
services/stream-handler/src/services/mq.ts
import { connect } from "amqplib"; import { config } from "../config"; const { mqUrl, queueName } = config; const getConnection = () => { return connect(mqUrl); }; const getChannel = async () => { const connection = await getConnection(); return connection.createChannel(); }; const getQueue = async () => { ...
haalto/mop-twitter-pipeline
services/api/src/helpers.ts
import { getSession } from "./neo4j"; export const createQuery = async (query: string, parameters = {}) => { const session = getSession(); try { const result = await session.run(query, parameters); session.close(); return result.records; } catch (err) { session.close(); console.log(""); t...
haalto/mop-twitter-pipeline
services/client/src/components/Graph.tsx
<gh_stars>0 import React, { ReactNode, useEffect, useState } from "react"; import Graph from "graphology"; import forceAtlas2 from "graphology-layout-forceatlas2"; import chroma from "chroma-js"; import { random } from "graphology-layout"; import { useSigma, useRegisterEvents, useLoadGraph, useSetSettings, } fr...
haalto/mop-twitter-pipeline
services/api/src/resolvers/TweetResolver.ts
import { Query, Resolver } from "type-graphql"; import Tweet from "../schemas/Tweet"; import { getTweets, getTweetsWithUsers } from "../services/tweetServices"; @Resolver(Tweet) export default class { @Query(() => [Tweet]) async tweetsWithUsers() { const tweetsWithUsers = await getTweetsWithUsers(); return...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/merge-all/merge-map.shortcuts.ts
<gh_stars>0 import { IMapFunction, ISubscribeFunction, mergeMapSubscribePipe, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { mergeMapSubscribePipe as mergeMap$$$, } from '@lifaon/rx-js-light'; export function mergeMap$$<GIn, GOut>( subscribe: ISubscribeFunction<GIn>, mapFunction: IMapFunction<GIn,...
lifaon74/rx-js-light-shortcuts
src/source/const.shortcuts.ts
export { createReadonlyMulticastReplayLastSource as const$$, } from '@lifaon/rx-js-light';
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/merge-all/merge-map-with-notifications.shortcuts.ts
import { IDefaultNotificationsUnion, IInferEmitPipeToSubscribePipeEmitPipeInValue, IMapFunction, ISubscribeFunction, mergeMapSingleSubscribePipeWithNotifications, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { mergeMapSingleSubscribePipeWithNotifications as mergeMapSN$$$, } from '@lifaon/rx-js-ligh...
lifaon74/rx-js-light-shortcuts
src/emit-pipe/tap.shortcuts.ts
<filename>src/emit-pipe/tap.shortcuts.ts import { composeEmitFunction, tapEmitPipe, IEmitFunction, ITabCallback } from '@lifaon/rx-js-light'; export { tapEmitPipe as $$$tap, } from '@lifaon/rx-js-light'; export function $$tap<GValue>( emit: IEmitFunction<GValue>, callback: ITabCallback<GValue> ): IEmitFunction<...
lifaon74/rx-js-light-shortcuts
src/from/many/reactive-function/index.ts
<gh_stars>0 export * from './arithmetic.shortcuts'; export * from './comparison.shortcuts'; export * from './logic.shortcuts'; export * from './reactive-function.shortcuts'; export * from './string.shortcuts';
lifaon74/rx-js-light-shortcuts
src/emit-pipe/filter.shortcuts.ts
<gh_stars>0 import { composeEmitFunction, filterEmitPipe, IEmitFunction, IFilterFunctionBasic, IFilterFunctionStrict } from '@lifaon/rx-js-light'; export { filterEmitPipe as $$$filter, } from '@lifaon/rx-js-light'; export function $$filter<GValue>( emit: IEmitFunction<GValue>, filterFunction: IFilterFunctionBas...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/merge-all/index.ts
export * from './merge-all.shortcuts'; export * from './merge-all-single.shortcuts'; export * from './merge-map.shortcuts'; export * from './merge-map-single.shortcuts'; export * from './merge-map-with-notifications.shortcuts';
lifaon74/rx-js-light-shortcuts
src/emit-pipe/distinct.shortcuts.ts
<reponame>lifaon74/rx-js-light-shortcuts import { composeEmitFunction, distinctEmitPipe, IEmitFunction } from '@lifaon/rx-js-light'; export { distinctEmitPipe as $$$distinct, } from '@lifaon/rx-js-light'; export function $$distinct<GValue>( emit: IEmitFunction<GValue>, ): IEmitFunction<GValue> { return composeE...
lifaon74/rx-js-light-shortcuts
src/from/many/reactive-function/comparison.shortcuts.ts
export { reactiveEqual as eq$$, reactiveNotEqual as neq$$, reactiveGreaterThan as gt$$, reactiveGreaterThanOrEqual as gte$$, reactiveLowerThan as lt$$, reactiveLowerThanOrEqual as lte$$, } from '@lifaon/rx-js-light';
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/emit-pipe-related/tap.shortcuts.ts
<reponame>lifaon74/rx-js-light-shortcuts<filename>src/subscribe-pipe/emit-pipe-related/tap.shortcuts.ts import { ISubscribeFunction, ITabCallback, pipeSubscribeFunction, tapSubscribePipe } from '@lifaon/rx-js-light'; export { tapSubscribePipe as tap$$$, } from '@lifaon/rx-js-light'; export function tap$$<GValue>( ...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/merge-all/merge-map-single.shortcuts.ts
import { IMapFunction, ISubscribeFunction, mergeMapSingleSubscribePipe, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { mergeMapSingleSubscribePipe as mergeMapS$$$, } from '@lifaon/rx-js-light'; export function mergeMapS$$<GIn, GOut>( subscribe: ISubscribeFunction<GIn>, mapFunction: IMapFunction<GI...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/time-related/index.ts
export * from './debounce.shortcuts'; export * from './debounce-frame.shortcuts';
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/emit-pipe-related/scan.shortcuts.ts
import { IScanFunction, ISubscribeFunction, scanSubscribePipe, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { scanSubscribePipe as scan$$$, } from '@lifaon/rx-js-light'; export function scan$$<GIn, GOut>( subscribe: ISubscribeFunction<GIn>, scanFunction: IScanFunction<GIn, GOut>, initialValue: G...
lifaon74/rx-js-light-shortcuts
src/from/many/index.ts
<reponame>lifaon74/rx-js-light-shortcuts export * from './reactive-function/index';
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/time-related/debounce.shortcuts.ts
<gh_stars>0 import { debounceTimeSubscribePipe, ISubscribeFunction, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { debounceTimeSubscribePipe as debounce$$$, } from '@lifaon/rx-js-light'; export function debounce$$<GValue>( subscribe: ISubscribeFunction<GValue>, duration: number, ): ISubscribeFunc...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/emit-pipe-related/index.ts
export * from './distinct.shortcuts'; export * from './filter.shortcuts'; export * from './map.shortcuts'; export * from './map-filter.shortcuts'; export * from './scan.shortcuts'; export * from './tap.shortcuts';
lifaon74/rx-js-light-shortcuts
src/emit-pipe/scan.shortcuts.ts
import { composeEmitFunction, IEmitFunction, IScanFunction, scanEmitPipe } from '@lifaon/rx-js-light'; export { scanEmitPipe as $$$scan, } from '@lifaon/rx-js-light'; export function $$scan<GIn, GOut>( emit: IEmitFunction<GOut>, scanFunction: IScanFunction<GIn, GOut>, initialValue: GOut, ): IEmitFunction<GIn>...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/merge-all/merge-map-single-with-notifications.shortcuts.ts
import { IDefaultNotificationsUnion, IInferEmitPipeToSubscribePipeEmitPipeInValue, IMapFunction, ISubscribeFunction, mergeMapSubscribePipeWithNotifications, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { mergeMapSubscribePipeWithNotifications as mergeMapN$$$, } from '@lifaon/rx-js-light'; export f...
lifaon74/rx-js-light-shortcuts
src/from/many/reactive-function/arithmetic.shortcuts.ts
<reponame>lifaon74/rx-js-light-shortcuts export { reactiveAdd as add$$, reactiveAddMany as addM$$, reactiveSubtract as sub$$, reactiveMultiply as mul$$, reactiveDivide as div$$, } from '@lifaon/rx-js-light';
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/emit-pipe-related/map.shortcuts.ts
import { IMapFunction, ISubscribeFunction, mapSubscribePipe, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { mapSubscribePipe as map$$$, } from '@lifaon/rx-js-light'; export function map$$<GIn, GOut>( subscribe: ISubscribeFunction<GIn>, mapFunction: IMapFunction<GIn, GOut>, ): ISubscribeFunction<GO...
lifaon74/rx-js-light-shortcuts
src/from/many/reactive-function/reactive-function.shortcuts.ts
<filename>src/from/many/reactive-function/reactive-function.shortcuts.ts export { reactiveFunction as function$$, distinctReactiveFunction as functionD$$, } from '@lifaon/rx-js-light';
lifaon74/rx-js-light-shortcuts
src/index.ts
export * from './emit-pipe/index'; export * from './from/index'; export * from './i18n/index'; export * from './piping/index'; export * from './source/index'; export * from './subscribe-pipe/index';
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/emit-pipe-related/distinct.shortcuts.ts
import { createMulticastReplayLastSource, distinctSubscribePipe, IShareSubscribePipeGetMultiCastSource, ISubscribeFunction, ISubscribePipeFunction, pipeSubscribeFunction, pipeSubscribePipeFunctions, shareSubscribePipe } from '@lifaon/rx-js-light'; export { distinctSubscribePipe as distinct$$$, } from '@lifaon/...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/source-related/index.ts
<gh_stars>0 export * from './share.sortcuts';
lifaon74/rx-js-light-shortcuts
src/from/many/reactive-function/logic.shortcuts.ts
export { reactiveAnd as and$$, reactiveAndMany as andM$$, reactiveNotAndMany as notAndM$$, reactiveOr as or$$, reactiveOrMany as orM$$, reactiveNotOrMany as notOrM$$, reactiveNot as not$$, } from '@lifaon/rx-js-light';
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/time-related/debounce-frame.shortcuts.ts
import { debounceFrameSubscribePipe, ISubscribeFunction, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { debounceFrameSubscribePipe as frame$$$, } from '@lifaon/rx-js-light'; export function debounceFrame$$<GValue>( subscribe: ISubscribeFunction<GValue>, ): ISubscribeFunction<GValue> { return pipe...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/merge-all/merge-all.shortcuts.ts
<gh_stars>0 import { ISubscribeFunction, mergeAllSubscribePipe, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { mergeAllSubscribePipe as mergeAll$$$, } from '@lifaon/rx-js-light'; export function mergeAll$$<GValue>( subscribe: ISubscribeFunction<ISubscribeFunction<GValue>>, maxNumberOfSubscriptions...
lifaon74/rx-js-light-shortcuts
src/source/index.ts
<reponame>lifaon74/rx-js-light-shortcuts<gh_stars>0 export * from './const.shortcuts'; export * from './let.shortcuts';
lifaon74/rx-js-light-shortcuts
src/from/index.ts
export * from './many/index'; export * from './from.shortcuts';
lifaon74/rx-js-light-shortcuts
src/emit-pipe/map.shortcuts.ts
import { composeEmitFunction, IEmitFunction, IMapFunction, mapEmitPipe } from '@lifaon/rx-js-light'; export { mapEmitPipe as $$$map, } from '@lifaon/rx-js-light'; export function $$map<GIn, GOut>( emit: IEmitFunction<GOut>, mapFunction: IMapFunction<GIn, GOut>, ): IEmitFunction<GIn> { return composeEmitFuncti...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/merge-all/merge-all-single.shortcuts.ts
<reponame>lifaon74/rx-js-light-shortcuts<gh_stars>0 import { ISubscribeFunction, mergeAllSingleSubscribePipe, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { mergeAllSingleSubscribePipe as mergeAllS$$$, } from '@lifaon/rx-js-light'; export function mergeAllS$$<GValue>( subscribe: ISubscribeFunction<I...
lifaon74/rx-js-light-shortcuts
src/piping/index.ts
<reponame>lifaon74/rx-js-light-shortcuts<gh_stars>0 export * from './pipe-subscribe-function.shortcuts'; export * from './pipe-subscribe-pipe-functions.shortcuts';
lifaon74/rx-js-light-shortcuts
src/piping/pipe-subscribe-pipe-functions.shortcuts.ts
<reponame>lifaon74/rx-js-light-shortcuts export { pipeSubscribePipeFunctions as pipe$$$, } from '@lifaon/rx-js-light';
lifaon74/rx-js-light-shortcuts
src/i18n/index.ts
export * from './i18n.shortcuts';
lifaon74/rx-js-light-shortcuts
src/piping/pipe-subscribe-function.shortcuts.ts
<gh_stars>0 export { pipeSubscribeFunction as pipe$$, } from '@lifaon/rx-js-light';
lifaon74/rx-js-light-shortcuts
src/from/many/reactive-function/string.shortcuts.ts
<filename>src/from/many/reactive-function/string.shortcuts.ts export { reactiveTemplateString as string$$, } from '@lifaon/rx-js-light';
lifaon74/rx-js-light-shortcuts
src/emit-pipe/map-filter.shortcuts.ts
import { composeEmitFunction, IEmitFunction, IMapFilterMapFunction, mapFilterEmitPipe } from '@lifaon/rx-js-light'; export { mapFilterEmitPipe as $$$mapFilter, } from '@lifaon/rx-js-light'; export function $$mapFilter<GIn, GOut>( emit: IEmitFunction<GOut>, mapFunction: IMapFilterMapFunction<GIn, GOut>, ): IEmit...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/index.ts
<gh_stars>0 export * from './emit-pipe-related/index'; export * from './merge-all/index'; export * from './source-related/index'; export * from './time-related/index';
lifaon74/rx-js-light-shortcuts
src/from/from.shortcuts.ts
<reponame>lifaon74/rx-js-light-shortcuts export { single as single$$, reference as ref$$, } from '@lifaon/rx-js-light';
lifaon74/rx-js-light-shortcuts
src/i18n/i18n.shortcuts.ts
<reponame>lifaon74/rx-js-light-shortcuts export { dateTimeFormatSubscribePipe as dateTimeFormat$$$, listFormatSubscribePipe as listFormat$$$, numberFormatSubscribePipe as numberFormat$$$, currencyFormatSubscribePipe as currencyFormat$$$, pluralRulesSubscribePipe as pluralRules$$$, relativeTimeFormatSubscrib...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/emit-pipe-related/map-filter.shortcuts.ts
<filename>src/subscribe-pipe/emit-pipe-related/map-filter.shortcuts.ts<gh_stars>0 import { IMapFilterMapFunction, ISubscribeFunction, mapFilterSubscribePipe, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { mapFilterSubscribePipe as mapFilter$$$, } from '@lifaon/rx-js-light'; export function mapFilter$$...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/emit-pipe-related/filter.shortcuts.ts
<reponame>lifaon74/rx-js-light-shortcuts import { filterSubscribePipe, IFilterFunctionBasic, IFilterFunctionStrict, ISubscribeFunction, pipeSubscribeFunction } from '@lifaon/rx-js-light'; export { filterSubscribePipe as filter$$$, } from '@lifaon/rx-js-light'; export function filter$$<GValue>( subscribe: ISubsc...
lifaon74/rx-js-light-shortcuts
src/subscribe-pipe/source-related/share.sortcuts.ts
<filename>src/subscribe-pipe/source-related/share.sortcuts.ts import { createMulticastReplayLastSource, IShareSubscribePipeGetMultiCastSource, ISubscribeFunction, ISubscribePipeFunction, pipeSubscribeFunction, shareSubscribePipe } from '@lifaon/rx-js-light'; export { shareSubscribePipe as share$$$, } from '@li...
paulosouzav/memory-game-react
src/components/Image/__tests__/index.test.tsx
import React from 'react'; import { mount } from 'enzyme'; import { Image } from '../'; const IMAGE_PROPS = { src: 'fake/path/img.png', alt: 'Fake Image', }; describe('Image', () => { it('should render without failing', () => { const wrapper = mount(<Image {...IMAGE_PROPS} />); expect(wrapper).toMatchSn...
paulosouzav/memory-game-react
src/constants/__tests__/cards.test.tsx
import { CARDS, DEFAULT_CARD_IMAGE } from '../cards'; describe('CARDS', () => { it('should have expected values', () => { expect(CARDS).toMatchSnapshot(); }); }); describe('DEFAULT_CARD_IMAGE', () => { it('should have expected values', () => { expect(DEFAULT_CARD_IMAGE).toMatchSnapshot(); }); });
paulosouzav/memory-game-react
src/containers/MemoryGame/utils.tsx
<reponame>paulosouzav/memory-game-react import shuffle from 'lodash/shuffle'; import { ICard } from '../../components/Card'; const addKey = (card: ICard, index: number) => ({ ...card, key: `card-${index}`, }); export const generateBoardCards = (cards: Array<ICard>) => { const duplicatedCards = [...cards, ...car...
paulosouzav/memory-game-react
src/constants/cards.tsx
import Asteroid from '../assets/cards/002-asteroid.png'; import Earth from '../assets/cards/006-planet-earth.png'; import Mars from '../assets/cards/017-mars.png'; import Sun from '../assets/cards/033-sun.png'; import Saturn from '../assets/cards/028-saturn.png'; import Spaceship from '../assets/cards/014-space-ship.pn...
paulosouzav/memory-game-react
src/constants/colors.tsx
<filename>src/constants/colors.tsx<gh_stars>0 import { transparentize } from 'polished'; export const COLORS = Object.freeze({ transparent: 'rgba(0,0,0,0)', black: '#000000', white: '#ffffff', blue: '#007bff', indigo: '#6610f2', purple: '#6f42c1', pink: '#e83e8c', red: '#dc3545', orange: '#fd7e14', ...
paulosouzav/memory-game-react
src/constants/__tests__/screen.test.tsx
<gh_stars>0 import { BREAKPOINTS, MAX_WIDTHS } from '../screen'; describe('BREAKPOINTS', () => { it('should have expected values', () => { expect(BREAKPOINTS).toMatchSnapshot(); }); }); describe('MAX_WIDTHS', () => { it('should have expected values', () => { expect(MAX_WIDTHS).toMatchSnapshot(); }); }...
paulosouzav/memory-game-react
src/config/global-style.tsx
<reponame>paulosouzav/memory-game-react<filename>src/config/global-style.tsx import { createGlobalStyle } from 'styled-components'; import { FONT_FACES } from '../constants/fonts'; const GlobalStyle = createGlobalStyle` html { ${FONT_FACES} box-sizing: border-box; font-family: 'Roboto'; } *, *:before...
paulosouzav/memory-game-react
src/components/Card/__tests__/Face.test.tsx
<reponame>paulosouzav/memory-game-react import React from 'react'; import { mount } from 'enzyme'; import 'jest-styled-components'; import Face from '../Face'; describe('Face', () => { it('should render without failing', () => { const wrapper = mount(<Face />); expect(wrapper).toMatchSnapshot(); }); it(...
paulosouzav/memory-game-react
src/constants/__tests__/rotation.test.tsx
import { ROTATION } from '../rotation'; describe('ROTATION', () => { it('should have expected values', () => { expect(ROTATION).toMatchSnapshot(); }); });
paulosouzav/memory-game-react
src/containers/MemoryGame/Board.tsx
<gh_stars>0 import styled, { css } from 'styled-components'; interface Props { large?: boolean; medium?: boolean; } const Board = styled.div` width: 100%; max-width: 720px; margin: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; perspective: 1000px; ${({ medi...
paulosouzav/memory-game-react
src/components/EndGame/index.tsx
<gh_stars>0 import React from 'react'; import styled, { css } from 'styled-components'; import { transitions } from 'polished'; import { TRANSPARENT_BLACK } from '../../constants/colors'; import Button from '../Button'; import Title from './Title'; interface Props { active?: boolean; buttonAction?: React.MouseEven...
paulosouzav/memory-game-react
src/App.tsx
<gh_stars>0 import React, { Component } from 'react'; import { Game } from './views/Game'; class App extends Component { render() { return <Game />; } } export default App;
paulosouzav/memory-game-react
src/components/Container/index.tsx
<reponame>paulosouzav/memory-game-react<filename>src/components/Container/index.tsx<gh_stars>0 import styled, { css } from 'styled-components'; import { SIZES } from '../../constants/sizes'; import { MAX_WIDTHS } from '../../constants/screen'; import { mediaMin } from '../../utils/mediaQuery'; // Modifiers should alwa...
paulosouzav/memory-game-react
src/components/Button/__tests__/index.test.tsx
import React from 'react'; import Button from '../'; import { mount } from 'enzyme'; import 'jest-styled-components'; describe('Button', () => { it('should render without failing', () => { const wrapper = mount(<Button />); expect(wrapper).toMatchSnapshot(); }); });
paulosouzav/memory-game-react
src/components/Card/BaseCard.tsx
import styled, { css } from 'styled-components'; import { transitions } from 'polished'; import { SHADOWS } from '../../constants/shadows'; import { ROTATION } from '../../constants/rotation'; import { mediaMax } from '../../utils/mediaQuery'; import Face from './Face'; export interface IBaseCard { isFlipped?: boole...
paulosouzav/memory-game-react
src/components/EndGame/Title.tsx
import styled from 'styled-components'; import { COLORS, TRANSPARENT_BLACK } from '../../constants/colors'; import { mediaMax } from '../../utils/mediaQuery'; const Title = styled.h1` color: ${COLORS.white}; font-size: 50px; text-shadow: 0 0 8px ${TRANSPARENT_BLACK.normal}; text-align: center; line-height: ...
paulosouzav/memory-game-react
src/constants/__tests__/sizes.test.tsx
<gh_stars>0 import { SIZES } from '../sizes'; describe('SIZES', () => { it('should have expected values', () => { expect(SIZES).toMatchSnapshot(); }); });
paulosouzav/memory-game-react
src/constants/__tests__/colors.test.tsx
import { COLORS, TRANSPARENT_BLACK } from '../colors'; describe('COLORS', () => { it('should have expected values', () => { expect(COLORS).toMatchSnapshot(); }); }); describe('TRANSPARENT_BLACK', () => { it('should have expected values', () => { expect(TRANSPARENT_BLACK).toMatchSnapshot(); }); });
paulosouzav/memory-game-react
src/constants/sizes.tsx
<filename>src/constants/sizes.tsx export const SIZES = Object.freeze({ navHeight: '60px', });
paulosouzav/memory-game-react
src/utils/mediaQuery.tsx
import { css } from 'styled-components'; import { BREAKPOINTS } from '../constants/screen'; type MediaQuery = 'min' | 'max'; const mediaQuery = (type: MediaQuery) => Object.keys(BREAKPOINTS).reduce((acc: any, label: string) => { acc[label] = ( literals: TemplateStringsArray, ...placeholders: any[] ...
paulosouzav/memory-game-react
src/components/EndGame/__tests__/Title.test.tsx
import React from 'react'; import { mount } from 'enzyme'; import 'jest-styled-components'; import Title from '../Title'; describe('Title', () => { it('should render without failing', () => { const wrapper = mount(<Title />); expect(wrapper).toMatchSnapshot(); }); });
paulosouzav/memory-game-react
src/containers/MemoryGame/index.tsx
<gh_stars>0 import React, { PureComponent } from 'react'; import isEqual from 'lodash/isEqual'; import cloneDeep from 'lodash/cloneDeep'; import { Card, ICard } from '../../components/Card'; import { EndGame } from '../../components/EndGame'; import { CARDS } from '../../constants/cards'; import { Nullable } from '../....
paulosouzav/memory-game-react
src/constants/rotation.tsx
<reponame>paulosouzav/memory-game-react import { css } from 'styled-components'; export const ROTATION = { half: css` transform: rotateY(180deg); `, };
paulosouzav/memory-game-react
src/constants/__tests__/shadows.test.tsx
<reponame>paulosouzav/memory-game-react<filename>src/constants/__tests__/shadows.test.tsx import { SHADOWS } from '../shadows'; describe('SHADOWS', () => { it('should have expected values', () => { expect(SHADOWS).toMatchSnapshot(); }); });
paulosouzav/memory-game-react
src/components/Card/index.tsx
import React from 'react'; import { IImage } from '../Image'; import BaseCard, { IBaseCard } from './BaseCard'; import { DEFAULT_CARD_IMAGE } from '../../constants/cards'; export interface ICard extends IBaseCard { id: string; image: IImage; } export const Card = ({ image, ...cardProps }: ICard) => { return ( ...
paulosouzav/memory-game-react
src/constants/__tests__/fonts.test.tsx
import { FONTS, FONT_FACES } from '../fonts'; describe('FONTS', () => { it('should have expected values', () => { expect(FONTS).toMatchSnapshot(); }); }); describe('FONT_FACES', () => { it('should have expected values', () => { expect(FONT_FACES).toMatchSnapshot(); }); });
paulosouzav/memory-game-react
src/components/Button/index.tsx
import styled from 'styled-components'; import { COLORS } from '../../constants/colors'; import { FONTS } from '../../constants/fonts'; import { SHADOWS } from '../../constants/shadows'; import { darken } from 'polished'; const Button = styled.button` border-radius: 8px; padding: 15px 35px; font-size: 18px; f...
paulosouzav/memory-game-react
src/index.tsx
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import { Normalize } from 'styled-normalize'; import GlobalStyle from './config/global-style'; import * as serviceWorker from './serviceWorker'; const Root = () => ( <> <Normalize /> <GlobalStyle /> <App /> </> ); Re...