baramofme / notion-gcal-sync-appsscript

0 stars 0 forks source link

Improve accessibility by applying dynamic proxy get/setter to class container #6

Closed baramofme closed 3 weeks ago

baramofme commented 3 weeks ago

currently class tructure uses weakmap for strong garbage collection and hidden data from public.

I don't know it's a good choice. but, I need one thing now. make a dynamic getter and setter by applying proxy getter setter for accessing to weakmap data as key.

here's ref: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Proxy

baramofme commented 3 weeks ago

It might be not to have weakmap for this project and test feature.

However, due to sunk costs, it is not easy to reverse technical decisions already made.

so, Even if you can't eat it, go!

baramofme commented 3 weeks ago

here's a model. define proxy inside constructor, not outside .

https://stackoverflow.com/a/65331639

baramofme commented 3 weeks ago

Proxy is interesting

https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Proxy#%EC%99%84%EC%A0%84%ED%95%9C_trap_%EC%98%88%EC%A0%9C

baramofme commented 3 weeks ago

TypeError: Cannot use 'in' operator to search for 'importFromNotion' in undefined

baramofme commented 3 weeks ago

in operator cannot use find function in object.

so need to convert it to string.

It'll be working fine.