Skip to content

Instantly share code, notes, and snippets.

View PabloLION's full-sized avatar
🔍
Looking for half-time job

Pablo LION PabloLION

🔍
Looking for half-time job
  • Barcelona, Spain
View GitHub Profile
@PabloLION
PabloLION / TS-example-writing-produces-intersection.ts
Last active January 4, 2022 09:55
Writing produces type intersection in TS.
// https://github.com/microsoft/TypeScript/issues/47295
// https://stackoverflow.com/questions/70569105/proxy-property-in-setter-has-never-type
// https://www.typescriptlang.org/play?ts=4.6.0-dev.20220103#code/MYewdgzgLgBAtgTwPICMBWMC8MDeBYAKBhjAFc4AuGAWgEYAaQ4gQwCdWqBtBmAJnpgBmALqMiMaBxgByaWIC+AbkKFQkWAAdWIAB4IsJAKYB3GAAVtegBSJUaAfnERDUK1DYBzFwK0gNVAGtDBBAAMxgoBA1DMPhkdAEAN2YAG1JDAEpcJmIYAHoAKhJwQxhYqAALQ2cYYxBWAIgYAryc4jy8mAA1Q1YAOhhaNpgAS3CrXw1RsAjPFyz3Vi8oTknhA2S0w2Vxds6e-r5hxeXV7Q117E30ndz8-d6BwWO5lcmYZiagkPDI6NjbOhLjBrtthh1uo8YAAWYYQYwjKDACowCbnLKOO7EYCfUrSMhwaQUYbY3EySREkm5E4uM5+YGg25Y4goViGZgBJnEeQqXb5IrGCojFKlSrVUp1BpNFrgh6HACscIRSJRaL8GKpOJq+PIlL5dxpb3ODNSNypLLZHK5uS1eIpxP11NedIuG1NYMdFvZnOGPL5EIOAwAbErEcjUZMNY7bTICXrmcRDS6TVtrXdWd60zAACaGULMUgpKAOhOzJa0tZu1PmmAZq2+3l3NlQUisGZQVhm8TyBQZHaqcAQEAivopEAeKzSXx6GBUOQwacIPuEIA
const myObj = {
num: -1,
arr: [1, 2, 3],
str: '',
};
@PabloLION
PabloLION / propdiff.js
Last active November 26, 2021 20:36 — forked from albertorestifo/propdiff.js
Logs change with git diff style between current and previous object
// Example usage for React class component.
// Can also it for state or non-react JS.
componentDidUpdate(prevProps) {
logUpdatedDiff(prevProps, this.props)
}
/**
* @param {object} prev: previous to compare
* @param {object} current: current to compare
* @return {void}