Temporary Documents
Is there a built-in way to create temporary entities? Like entities wich are not stored in the database, but remains in memory for .update etc
8 Replies
There is!
https://foundryvtt.com/api/abstract.Document.html#.create
The second arg here is "context":
https://foundryvtt.com/api/global.html#DocumentModificationContext
So basically you can do this:
wow
i thought it was a long shot
ty!
sadly... it does not work as I intended
i cant use setflag nor update with a temporary journal =/
What are you attempting?
If you know this information when the journal is created, you can set it then right?
Im building an application wich stores some information in journals (the easiest way I found to store things in the DB)... creating my own entities seemed to much trouble, but can also be used in a default state without any journal being selected.
I thought it would be much easier to create a temporary journal in case no journal is selected
instead of adding complexity to the logic behind it
Ahhh.
I'm honestly not too familiar with how one manipulates temporary documents, I know it's possible and has uses but they're probably different methods than for ones that exist in the db.
I see, ty im going to make some research on this, probably there is a way, if I find out I tell you xd