Schrodinger's functionPromises and throw considered harmful Take for example the code below function createUser(email: string): User { if (users.includes(email)) { throw new Error(`User with email ${email} already exists`) } ... return newUser; ...Sep 27, 2022 · 3 min readjoshuaamaju.hashnode.dev
Empty state viewI need to display an empty state when my list is empty. That should be easy, how do you plan on achieving that? Thought about several methods: Class toggling <div> <ul className={list.length > 0 ? 'show' : 'hide'}>...</ul> <div className={li...Sep 25, 2021 · 1 min readjoshuaamaju.hashnode.dev