FE Engineer @ Shopee
Singaporean 🇸🇬
where users can post tweets, follow/unfollow others, and is able to see the 10 most recent tweets in the user’s news feed.
Some useful functions to include would be
getNewsFeed(userid)
postTweet(userid, tweet)
unfollow(follower, followee)
follow(follower, followee)
maybe only for hackathons/side projects
Big picture view because details dont matter (yet)
but maybe unavoidable for some cases
Working
on FE
Working
on BE
Me
Me
Working
on FE
Working
on BE
and often not the goal of your app
but maybe think about the DOM structure for later
kinda like Reactjs
kinda like Nextjs
kinda like Gatsby
Pictured: me reading instructions
let parentTwat;
// fetch logic here
parentTwat = twatResponse.twats[0];
const [
parentTwat,
setParentTwat,
] = useState(null);
// fetch logic here
setParentTwat(twatResponse.twats[0]);
{#if !!parentTwat}
<div class="parent">
<div class="top">
<div>
<div class="name">
{parentTwat.username}
</div>
<div class="id">
{parentTwat.userId}
</div>
</div>
<div class="time">
{parentTwatTime}
</div>
</div>
<div class="twatContent">
{parentTwat.content}
</div>
</div>
{/if}
{ parentTwat &&(
<div class="parent">
<div class="top">
<div>
<div class="name">
{parentTwat.username}
</div>
<div class="id">
{parentTwat.userId}
</div>
</div>
<div class="time">
{parentTwatTime}
</div>
</div>
<div class="twatContent">
{parentTwat.content}
</div>
</div>
)}
export let segment;
const { segment } = this.props
{#each twats as twat(twat.twatId)}
<Twat {twat} />
{/each}
{ Twats.map(twat =>
<Twat
twat={twat}
key={twat.twatid}]
/>
)}
if (sendTweetObj.success) {
const successEvent = new CustomEvent("twatSuccess", {});
window.dispatchEvent(successEvent);
}
<svelte:window on:twatSuccess={twatSuccess} on:twatFollow={twatSuccess} />
twitter, but for twats
maybe end of 2020