This file contains 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
// services | |
const fetchConfig = () => Promise.resolve({ hereId: 'foo', hereCode: 'bar' }) | |
const fetchOrder = () => Promise.resolve({ status: 'done', pods: [1, 2, 3] }) | |
const fetchOrder2 = () => { | |
if (Math.random() > 0.5) { | |
return Promise.resolve({ status: 'done', pods: [1, 2, 3] }) | |
} else { | |
return Promise.reject({ errorMessage: 'foo' }) | |
} | |
} |
This file contains 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
// services | |
const fetchConfig = () => Promise.resolve({ hereId: 'foo', hereCode: 'bar' }) | |
const fetchOrder = () => Promise.resolve({ status: 'done', pods: [1, 2, 3] }) | |
const fetchOrder2 = () => { | |
if (Math.random() > 0.5) { | |
return Promise.resolve({ status: 'done', pods: [1, 2, 3] }) | |
} else { | |
return Promise.reject({ errorMessage: 'foo' }) | |
} | |
} |
This file contains 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
# AUTOMATIC MIGRATION FROM WEBPACK TO VITE | |
# chmod +x migrate-to-vite.sh to make this file executable | |
# installing codemods | |
# https://docs.python-guide.org/starting/install3/osx/ | |
# https://dev.to/malwarebo/how-to-set-python3-as-a-default-python-version-on-mac-4jjf | |
# https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py | |
# NO NEED; ALREADY ON MASTER - (manual action) |
This file contains 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
// services | |
const fetchConfig = () => Promise.resolve({ hereId: 'foo', hereCode: 'bar' }) | |
const fetchOrder = () => Promise.resolve({ status: 'done', pods: [1, 2, 3] }) | |
const fetchIntl = () => Promise.resolve({ messages: { foo: 'bar' } }) | |
const fetchMachine = Machine( | |
{ | |
id: 'tracking-app', | |
initial: 'loading', | |
context: { |
This file contains 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 setOnline = assign({ | |
offline: (context, event) => (context.offline = false), | |
}) | |
const setOffline = assign({ | |
offline: (context, event) => (context.offline = true), | |
}) | |
const setLastUpdate = assign({ | |
lastUpdate: (context, event) => (context.lastUpdate = Date.now()), | |
}) | |
const setStatusOk = assign({ |
This file contains 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
// @see https://github.com/NoriSte/recoil-apis | |
import { FC } from "react"; | |
import * as React from "react"; | |
import { createContext } from "react"; | |
import { generateRecoilId } from "./core"; | |
export const RecoilContext = createContext(""); | |
export const RecoilRoot: FC = (props) => { |
This file contains 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
// @see https://github.com/NoriSte/recoil-apis | |
type Callback = () => void; | |
/** | |
* Subscribe/unsubscribe to all the updates of the involved Recoil Values | |
*/ | |
const useSubscribeToRecoilValues = <T>( | |
recoilValue: RecoilValue<T>, | |
callback: Callback | |
) => { |
This file contains 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
// @see https://github.com/NoriSte/recoil-apis | |
/** | |
* Recoil-like atom creation. | |
*/ | |
export const atom = <T>(atom: Atom<T>) => { | |
// ... | |
return atom; | |
}; |
This file contains 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
// @see https://github.com/NoriSte/recoil-apis | |
/** | |
* Register a new Recoil Value idempotently. | |
* @private | |
*/ | |
export const registerRecoilValue = <T>( | |
recoilId: string, | |
recoilValue: RecoilValue<T> | |
) => { |