Menu

Our setup wizard writes nothing to the database until the last step, and the Back button still works
📰

Our setup wizard writes nothing to the database until the last step, and the Back button still works

DEV Community: typescript·Daniel Pertu·4 days ago
#1FJKGvHi
#devtotypescript#devto#dev#const#kind
Reading 0:00
15s threshold

Setting up a campaign in Nakodo is one decision per screen: who to look for, where to look, which businesses and places if you picked businesses, this campaign's share of the day's new emails if your plan has more than one campaign, and finally your website, which is the step that actually creates something. Then a review page.

The whole list is one function:

export function setupStepList ( kind : CampaignKind | null , emails : boolean ): Step [] { return [ " kind " , " where " , ...( kind === " businesses " ? ([ " businesses " ] as const ) : []), ...( emails ? ([ " emails " ] as const ) : []), " website " , " review " , ]; }

Enter fullscreen mode

Exit fullscreen mode

Four entries for most people, six for a business campaign on a plan with more than one campaign.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.