I hereby claim:
- I am kubk on github.
- I am egor_gorbachev (https://keybase.io/egor_gorbachev) on keybase.
- I have a public key ASAZpwkBP5PnzFEENyQZoTQIemsMbbVViL2UCb269xxfkAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| // node detect-unused-methods.mjs /path/to/frontend-folder | |
| #!/usr/bin/env node | |
| import { createRequire } from "node:module"; | |
| import fs from "node:fs"; | |
| import path from "node:path"; | |
| import { fileURLToPath } from "node:url"; | |
| const repoRoot = path.dirname(fileURLToPath(import.meta.url)); | |
| const args = process.argv.slice(2); |
| import { makeAutoObservable } from 'mobx'; | |
| import { avoidMobxAutoObservable } from './avoid-mobx-auto-observable'; | |
| import { types } from 'util'; | |
| test('avoidMobxAutoObservable allows to avoid Mobx auto conversion', () => { | |
| class Store { | |
| constructor(public dependency: object) { | |
| makeAutoObservable(this); | |
| } | |
| } |
| // turn off https://intellij-support.jetbrains.com/hc/en-us/articles/360005137400-Cmd-Shift-A-hotkey-opens-Terminal-with-apropos-search-instead-of-the-Find-Action-dialog | |
| brew install git node@16 php@8 | |
| pecl install xdebug && php -m | grep xdebug | |
| // cp .id_rsa and .id_rsa.pub | |
| // Apps: | |
| // Raycast, Rectangle App, Maccy |
| import { TimeTrackerStore } from './time-tracker-store'; | |
| import { action, makeAutoObservable } from 'mobx'; | |
| class Counter { | |
| value = 0; | |
| intervalId?: NodeJS.Timer; | |
| constructor() { | |
| makeAutoObservable(this); | |
| } |
| # Fix inotify issue: https://stackoverflow.com/a/56156015 |
| export class PlayerStore { | |
| song?: Song; | |
| isPlaying = false; | |
| constructor() { | |
| makeAutoObservable(this); | |
| } | |
| playSong(song: Song) { | |
| this.song = song; |
| class UsersStore { | |
| isLoaded = false; | |
| users = []; | |
| constructor() { | |
| makeAutoObservable(this) | |
| } | |
| loadUsers() { | |
| if (this.isLoaded) { |
| Ссылки: | |
| - Лишний ререндер: https://codesandbox.io/s/usecontext-problem-b6evb | |
| - Переизобретают Mobx с массой ограничений: https://habr.com/ru/post/546124/ | |
| - Разработчики из Atlassian не смогли переписать react-beautiful-dnd с Redux на контекст из-за проблем с перформансом: https://github.com/atlassian/react-beautiful-dnd/issues/1576#issuecomment-549643226 |
| class ListStore<T> { | |
| isLoading = false; | |
| list: T[] = []; | |
| constructor(loadList: () => Promise<T[]>) { | |
| makeAutoObservable(this) | |
| } | |
| loadList() { | |
| this.isLoading = true; |