Currently setting the persistence type is restricted to a discriminated union of either none or url. However, if we want to extend this such as adding a logging or local storage flag it means whatever is reading the url will not recognize it as being set. In addition, if we want to combine these extensions such as logging with url or local storage, all "plugins" need to be aware of this and have logic in them to deal with this.
My suggestion is to make the persistence type be a Set or Array so that anything needing to read this data can simply check if their flag is set in the atom.
Please let me know if I missed something or this can be accomplished in another way.
We have a new persistence API coming out shortly that should be much more general, composable, and work for a wider range of situations. Please stay tuned!
While we don't have the library published yet with multiple per-defined persistence types, this API is available to support this direction. (cc @bezi)
Most helpful comment
We have a new persistence API coming out shortly that should be much more general, composable, and work for a wider range of situations. Please stay tuned!