Skip to content

Instantly share code, notes, and snippets.

View yleflour's full-sized avatar

Yann Leflour yleflour

View GitHub Profile
@yleflour
yleflour / machine.js
Last active August 5, 2020 19:12
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
diff --git a/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js b/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js
index 43fb09e..b62e654 100644
--- a/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js
+++ b/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js
@@ -145,10 +145,11 @@ var OneToManySubjectBuilder = /** @class */ (function () {
parentSubject: subject,
canBeUpdated: true,
identifier: removedRelatedEntityRelationId,
- changeMaps: [{
- relation: relation.inverseRelation,
@yleflour
yleflour / callback-promises-async.ts
Created February 7, 2022 09:09
Callback / Promises / Async
// Callback
const asyncPowWithCallback = (arg1, timeout, callback: (error, value) => void) => {
setTimeout(() => {
callback(null, arg1*arg1);
}, timeout);
}
const value = asyncPowWithCallback(2, 100, (error, value) => {
console.log("value1");
});
import React, { useContext } from "react";
import { createContext } from "react";
export const contextFactory = <TParams, TStore>(useStore: (args: TParams) => TStore) => {
const Context = createContext<TStore>(null as TStore);
const useStoreContext = () => useContext(Context);
const Provider = (
props: