This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fastGlob from 'fast-glob'; | |
| import { promises as fsp } from 'node:fs'; | |
| import { createRequire } from 'node:module'; | |
| import path from 'node:path'; | |
| import { fileURLToPath } from 'node:url'; | |
| import { parseArgs } from 'node:util'; | |
| const _require = createRequire(fileURLToPath(import.meta.url)); | |
| async function generateExports(packageName, force) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface Fn<Args extends any[] = [], Result = void> { | |
| (...args: Args): Result; | |
| } | |
| export type Getter<T> = Fn<[track: Track], T>; | |
| export type Setter<T> = Fn<[value: T], void>; | |
| export type Updater<T> = Fn<[reducer: Fn<[value: T], T>], void>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Action } from '@reatom/core'; | |
| export function isAction(arg: any): arg is Action<any> { | |
| return arg && typeof arg === 'object' && typeof arg.type === 'string'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const paths = declareAtom({}, on => [ | |
| on(itemsAtom, (state, items) => { | |
| const ims = values(items); | |
| const paths = {}; | |
| for (const id of ims) { | |
| paths[id] = getPathForItem(id, items); | |
| } | |
| return paths; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { FC } from 'react'; | |
| import { useAtom } from '@reatom/react'; | |
| import { declareAtom } from '@reatom/core'; | |
| interface TreeNode { | |
| id: string; | |
| parentId: string | null; | |
| name: string; | |
| children: string[]; | |
| properties: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useContext, useEffect } from 'react'; | |
| import { context } from '@reatom/react'; | |
| export function useActionEffect(actionCreator, callback) { | |
| const store = useContext(context); | |
| useEffect(() => store.subscribe(actionCreator, () => callback()), [store, callback]); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const EFFECT = Symbol('@@Reatom/EFFECT'); | |
| function createActionCreatorWithEffect(type, effect) { | |
| return (payload) => ({ | |
| type, | |
| payload, | |
| [EFFECT]: (store) => effect(payload, store), | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Http\Request; | |
| /** | |
| * Class ApolloUpload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* Prototype file of PHP parser. | |
| * Written by Masato Bito | |
| * This file is PUBLIC DOMAIN. | |
| */ | |
| $buffer = null; | |
| $token = null; | |
| $toktype = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react' | |
| import validator from 'react-verificator' | |
| const mapValidatorToProps = ({ ownProps, validator }) => ({ | |
| validator | |
| }) | |
| @validator({ | |
| rules: { | |
| name: 'required', |
NewerOlder