Skip to content

Commit

Permalink
Update TIL listing
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jan 28, 2024
1 parent a9ac081 commit 0298bf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

This is a collection of short notes of the things I have learned on a daily basis while working on different technologies. I share these notes as I [learn in public](https://www.learninpublic.org/).

_**112** TILs and counting..._
_**113** TILs and counting..._

- 2024-01-28: [Send analytics data using the Beacon API](https://github.com/petermekhaeil/til/blob/master/./learnings/js-beacon-api.md)
- 2024-01-03: [TypeScript: ElementRef for React.useRef](https://github.com/petermekhaeil/til/blob/master/./learnings/ts-react-elementref.md)
- 2024-01-02: [Null is a billion-dollar mistake](https://github.com/petermekhaeil/til/blob/master/./learnings/null-billion-dollar-mistake.md)
- 2024-01-01: [TypeScript: exactOptionalPropertyTypes](https://github.com/petermekhaeil/til/blob/master/./learnings/ts-exact-optional-property-types.md)
Expand Down
6 changes: 6 additions & 0 deletions feed.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[
{
"content": "# Send analytics data using the Beacon API\n\nThe `navigator.sendBeacon()` method is intended to be used for sending analytics data to a server.\n\n```js\nnavigator.sendBeacon(\"/log\", analyticsData);\n```\n\n- It sends the HTTP POST request asynchronously, with no access to the server response.\n- The request is non-blocking, causing no delay to unload or the next navigation.\n\nSee [documentation](https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API) on usage.",
"date": "2024-01-28",
"path": "js-beacon-api.md",
"title": "Send analytics data using the Beacon API"
},
{
"content": "# TypeScript: ElementRef for React.useRef\n\nYou can extract the type from a `useRef` hook using `ElementRef`:\n\n```tsx\nimport { useRef, ElementRef } from \"react\";\n \nconst Component = () => {\n const audioRef = useRef<ElementRef<\"audio\">>(null);\n// ^? React.RefObject<HTMLAudioElement>\n\n return <audio ref={audioRef}>Hello</audio>;\n};\n```\n\nRead [Matt Pocock's Strongly Type useRef with ElementRef](https://www.totaltypescript.com/strongly-type-useref-with-elementref).",
"date": "2024-01-03",
Expand Down

0 comments on commit 0298bf9

Please sign in to comment.