Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

TS how can I this function write to a arrow function?

$
0
0

How can I write this generic function with a arrow function ?

function simpleState<T>(initial: T): [() => T, (v: T) => void] {  let value: T = initial;  return [    () => value,    (v: T) => {      value = v;    }  ]};

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>