Skip to content

Instantly share code, notes, and snippets.

View mahdikhashan's full-sized avatar
🏸

Mahdi Khashan mahdikhashan

🏸
View GitHub Profile
@mahdikhashan
mahdikhashan / mutableSource.tsx
Created March 21, 2023 00:05 — forked from Aslemammad/mutableSource.tsx
Consistent version of useMutableSource.
// Consistent version of `useMutableSource`, Inspired by https://github.com/pmndrs/valtio/blob/master/src/useMutableSource.ts
import { useEffect, useRef, useState } from 'react';
const TARGET = Symbol('target');
const GET_VERSION = Symbol('getVersion');
export type Source<TargetType extends any, VersionType extends any> = {
[TARGET]: TargetType;
[GET_VERSION]: (target: TargetType) => VersionType;
};
@mahdikhashan
mahdikhashan / release.config.js
Created April 18, 2023 09:57 — forked from yyynnn/release.config.js
release.config.js
/* eslint-disable no-template-curly-in-string */
const gitlabUrl = 'https://gitlab.com'
const gitlabApiPathPrefix = '/api/v4'
const assets = [
{ path: 'index.js', label: 'JS distribution' }
]
const verifyConditions = [
['@semantic-release/changelog'],