StoreItem
클래스에는 두 개의 값(amount
, status
)이 있습니다. 한 값을 변경했을 때 다른 값을 함께 변경하고 싶다면 어떻게 하는 게 좋을까요?
StoreItemA
:setAmount()
내에서 변경한다StoreItemB
: Observable을 사용해서 업데이트하자
// Replace ReadonlyDeep with Readonly if you don't want to use type-fest | |
import type { ReadonlyDeep } from 'type-fest'; | |
import { proxy } from 'valtio'; | |
/** | |
* Simple history-keeping store with undo/redo. | |
* You can also subscribe to the history itself | |
* (which isn't possible with `proxyWithHistory()`). | |
*/ | |
interface HistoryStore<T extends object> { |
StoreItem
클래스에는 두 개의 값(amount
, status
)이 있습니다. 한 값을 변경했을 때 다른 값을 함께 변경하고 싶다면 어떻게 하는 게 좋을까요?
StoreItemA
: setAmount()
내에서 변경한다StoreItemB
: Observable을 사용해서 업데이트하자/** | |
* @license MIT | |
* | |
* MIT License | |
* | |
* Copyright (c) 2020 Yehyoung Kang | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
# Add this to TOP of the .bashrc | |
# This could also be added to bottom, honestly I have no idea | |
# Configure __git_ps1 (which we'll use later) | |
GIT_PS1_SHOWDIRTYSTATE=1 | |
GIT_PS1_SHOWSTASHSTATE=1 | |
GIT_PS1_SHOWUNTRACKEDFILES=1 | |
GIT_PS1_SHOWUPSTREAM="auto" | |
GIT_PS1_SHOWCOLORHINTS=1 |
const fs = require('fs'); | |
const path = require('path'); | |
const wrapperHtml = '<p style="text-align: center"> </p>'; | |
const contentHtml = '<details style="border: 1px solid blue; WIDTH: 20em"><summary>Test</summary>The quick brown fox jumps over the lazy dog</details>'; | |
const tags = [ | |
//Inline tags | |
'a', |
//1. Go to Chrome Extensions page | |
//2. Activate developer mode | |
//3. Open the background page of any extension | |
//4. Paste the following code in the DevTools console | |
chrome.storage.local.getBytesInUse(null, bytesInUse => { | |
if (chrome.runtime.lastError) | |
throw chrome.runtime.lastError; | |
const bytesAvailable = chrome.storage.local.QUOTA_BYTES - bytesInUse; |