Skip to content

Instantly share code, notes, and snippets.

View dovranJorayev's full-sized avatar

dovran dovranJorayev

View GitHub Profile
import {
createJsonQuery,
createQuery,
unknownContract,
} from '@farfetched/core';
import { allSettled, fork } from 'effector';
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';
import { describe, expect, it } from 'vitest';
import nx from '@nx/eslint-plugin';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import * as tseslint from 'typescript-eslint';
import * as reactHooks from 'eslint-plugin-react-hooks';
import path from 'path';
const __dirname = path.resolve();
// Setup compatibility layer for legacy eslint plugins
@dovranJorayev
dovranJorayev / to-effect.ts
Created August 24, 2024 02:09
Effector operator to create Effector Effect from @farfetched/core remote operations
// shared/lib/farfetched/to-effect.ts
import { Mutation, Query } from '@farfetched/core';
import { attach, createStore, sample } from 'effector';
import { nanoid } from 'nanoid';
import { DeferredPromise, makeDeferredPromise } from '../../promise';
const paramsKeySymbol = Symbol.for('operationEffectKey');
const setParamsId = (params: Record<string, unknown>) => {
const id = nanoid();
@dovranJorayev
dovranJorayev / mantine-notifications.ts
Last active October 2, 2024 12:10
Proof of concept app notification service implementation
// shared/lib/notifications/core.ts //////////////////////////////////////////////
import {
NotificationData,
NotificationsStore,
cleanNotifications,
cleanNotificationsQueue,
hideNotification,
showNotification,
updateNotification,
updateNotificationsState,
@dovranJorayev
dovranJorayev / from-query.ts
Created July 8, 2024 16:22
Util to create query instance in mobx primitives
import {
DefaultError,
QueryClient,
QueryKey,
QueryObserver,
QueryObserverResult,
UseBaseQueryOptions,
UseQueryOptions,
notifyManager,
} from '@tanstack/react-query';
diff --git a/node_modules/next-redux-wrapper/.DS_Store b/node_modules/next-redux-wrapper/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/node_modules/next-redux-wrapper/.DS_Store differ
diff --git a/node_modules/next-redux-wrapper/es6/index.d.ts b/node_modules/next-redux-wrapper/es6/index.d.ts
index 66c1548..181cf6d 100644
--- a/node_modules/next-redux-wrapper/es6/index.d.ts
+++ b/node_modules/next-redux-wrapper/es6/index.d.ts
@@ -1,6 +1,6 @@
/// <reference types="node" />
// shared/lib/notification/core.ts
import {
cleanNotifications,
cleanNotificationsQueue,
hideNotification,
showNotification,
updateNotification,
updateNotificationsState,
NotificationsStore,
NotificationData,
@dovranJorayev
dovranJorayev / model-context.ts
Created May 2, 2024 08:22
effector model react bindings
import {
ComponentType,
ForwardRefExoticComponent,
PropsWithoutRef,
RefAttributes,
createContext,
forwardRef,
useContext
} from 'react';
@dovranJorayev
dovranJorayev / gist:77211876ca937bd41cdbbe8c58b33247
Created April 17, 2024 09:35
Persist adapter for @mswjs/data
import {
SERIALIZED_INTERNAL_PROPERTIES_KEY,
type SerializedEntity,
} from '@mswjs/data/lib/db/Database';
import {
DATABASE_INSTANCE,
ENTITY_TYPE,
PRIMARY_KEY,
type Entity,
type FactoryAPI,
@dovranJorayev
dovranJorayev / entity-feature-declarative.ts
Created January 26, 2024 05:37
Declarative entity management
// shared/api/contracts.ts
export type CompanyDetailed = {
id: string;
name: string;
type: 'outcome' | 'income';
notes: string;
isLiked: boolean;
};
// shared/api/api-company/thunks.ts