Skip to content

Instantly share code, notes, and snippets.

{
"_id" : ObjectId("6652db9cffbfa69295336411"),
"account_number" : "012605903603",
"parcel_number" : "0126059036",
"plat_lot_major" : "012605",
"plat_block_minor" : "036",
"legal_description" : "S 90 FT OF S 480 FT OF N 510 FT OF E 290 FT OF W 320 FT OF N 1/2 OF NE 1/4 OF SW 1/4 LESS CO RD",
"details" : {
"PIN" : "0126059036",
"TAXPAYERNAME" : "MN CUSTOM HOMES LLC",
@shrimpy
shrimpy / great.js
Created December 10, 2020 22:29
Reactjs: useCallback and React.memo fun - code - 4
let _int_val = 0;
const IntValComp = React.memo(({initFunc}) => {
const [value, setValue] = React.useState(-1);
console.log('IntValComp');
React.useEffect(
() => {
const val = _int_val++;
if (_int_val >= 100000) _int_val = 0;
@shrimpy
shrimpy / ok.js
Created December 10, 2020 22:28
Reactjs: useCallback and React.memo fun - code - 3
let _int_val1 = 0;
const IntValComp1 = ({initFunc}) => {
const [value, setValue] = React.useState(-1);
console.log('IntValComp1');
React.useEffect(
() => {
const val = _int_val1++;
if (_int_val1 >= 100000) _int_val1 = 0;
@shrimpy
shrimpy / loop.js
Created December 10, 2020 22:26
Reactjs: useCallback and React.memo fun - code - 2
let _int_val2 = 0;
const IntValComp2 = ({initFunc}) => {
const [value, setValue] = React.useState(-1);
React.useEffect(
() => {
const val = _int_val2++;
if (_int_val2 >= 100000) _int_val2 = 0;
@shrimpy
shrimpy / sample.js
Created December 10, 2020 22:23
Reactjs: useCallback and React.memo fun - code - 1
let _int_val = 0;
const IntValComp = React.memo(({initFunc}) => {
const [value, setValue] = React.useState(-1);
// expect to init value once only
React.useEffect(
() => {
const val = _int_val++;
if (_int_val >= 100000) _int_val = 0;