RangerMauve / hyper-sdk

Make your own hyper apps!
https://www.youtube.com/watch?v=HyHk4aImd_I&list=PL7sG5SCUNyeYx8wnfMOUpsh7rM_g0w_cu&index=20
MIT License
290 stars 46 forks source link

When using await there is no option to persist #26

Closed AramZS closed 4 years ago

AramZS commented 4 years ago

When using this construction await DatArchive.create({ there doesn't seem to be anyway to pass the option to tell the archive to be persistent? It will continue to rotate the dat uri on every machine reboot?

Is there a way to have it emulate https://github.com/datproject/dat-node in having an archive uri that is persistent? I assume it means passing the key as dat-node did at https://github.com/datproject/dat-node/blob/master/index.js#L93 ? and I could def manually create a file somewhere to store it, but I don't see a way to use the await construction to pass that option to hyperdrive?

RangerMauve commented 4 years ago

Thanks for the patience, I've had a pretty busy week. 😛

With the promise based API it should actually be persisting by default, else you should be able to pass in a persist:true flag in the options.

Here's the code that is responsible for that: https://github.com/datproject/sdk/blob/master/promise.js#L146

Is there a particular thing you're seeing that makes it seem like you can't persist?

RangerMauve commented 4 years ago

Gonna close this for now. Feel free to reopen if you're still having trouble.