What are newUserProps()
I'm reading saaskit source, and I don't understand the point of
newUserProps()
. Why not just define isSubscribed
in the createUser()
function with all the other values as it is in the interface as well? We could just set it to false by default?8 Replies
If I want to add properties to my user, should i add them to
newUserProps()
or directly into createUser()
?@iuioiua
Hi there. Previously, the method you suggested was used. However, we moved the logic that generates the objects outside their respective
createX()
functions as it significantly improved usability. See https://github.com/denoland/saaskit/pull/292, https://github.com/denoland/saaskit/pull/290 and https://github.com/denoland/saaskit/pull/284 for more context.GitHub
refactor: comment logic in KV by iuioiua · Pull Request #290 · deno...
Part 2 of #284
Towards #267
GitHub
refactor: items logic in KV by iuioiua · Pull Request #284 · denola...
Before, functions within util/db.ts did too much. E.g. createItem() generated an item, set it in KV, and then returned the generated item. Now, functions only do one thing, making things easier to ...
thank you for linking these PRs. So if I want to add my own members i should add them to
newUserProps()
as long as I don't need to get the object from the key valueSorry, I don’t understand
anyways that's not really important, what I wanted is working now
Nice! Let me know if you have any other questions with SaaSKit 🙂