- Clear feature ownership
- Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
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
| #!/bin/bash | |
| wget -qO- https://get.docker.com/ | sh | |
| sudo usermod -aG docker $(whoami) | |
| sudo systemctl enable docker.service | |
| sudo systemctl start docker.service | |
| sudo yum install -y epel-release | |
| sudo yum install -y python-pip | |
| sudo yum upgrade -y python* | |
| sudo pip install docker-compose --force --upgrade |
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 useLocalQuery = <TQuery extends {response: any; variables: any}>( | |
| environment: Environment, | |
| query: any, | |
| inVariables: TQuery['variables'] = {} | |
| ): TQuery['response'] | null => { | |
| const variables = useDeepEqual(inVariables) | |
| const [dataRef, setData] = useRefState<SelectorData | null>(null) | |
| const disposablesRef = useRef<Disposable[]>([]) | |
| useEffect(() => { | |
| const {getRequest, createOperationDescriptor} = environment.unstable_internal |
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 const map = <T, O>(map: (input: T) => Promise<O> | O) => | |
| async function* mapGenerator(asyncIterable: AsyncIterableIterator<T>) { | |
| for await (const value of asyncIterable) { | |
| yield map(value); | |
| } | |
| }; | |
| export const filter = <T, U extends T>(filter: (input: T) => input is U) => | |
| async function* filterGenerator(asyncIterable: AsyncIterableIterator<T>) { |
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
| type Deferred<T> = { | |
| resolve: (value: T) => void; | |
| reject: (value: unknown) => void; | |
| promise: Promise<T>; | |
| }; | |
| function createDeferred<T>(): Deferred<T> { | |
| const d = {} as Deferred<T>; | |
| d.promise = new Promise<T>((resolve, reject) => { |
While the public API intended for users to use is the scheduler package, the reconciler currently
does not use scheduler's priority classes internally.
ReactFiberScheduler has its own internal "mini-scheduler" that uses the scheduler package
indirectly for its deadline-capable scheduleCallback.
This is kind of a documentation of implementation details that I suppose will be gone by the end of the year, but what can you do.
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 { useEffect, useRef } from 'react'; | |
| function getItem(storage, key) { | |
| const value = storage.getItem(key); | |
| if (!value) return null; | |
| try { | |
| return JSON.parse(value); | |
| } catch (error) { |
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
| /* | |
| Makes your remote containers low level API accessible via: | |
| import accessFederatedContainer from "access-federated-containers"; | |
| accessFederatedContainer("app2") | |
| */ | |
| /** @typedef {import("webpack").Compiler} Compiler */ | |
| /** @typedef {import("webpack").Compilation} Compilation */ |