Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature request: add a remote:"never" option per save #138
This is an edge case for me, but I have a case where a user model is used for login and that is sent up to the server. I'd like to not have the user's password in the localstorage after the login, so I can easily go in and do a:
Which is fine, but then there is a dirty user record sitting out there, that will never be saved to the server. It would be better if I could specify a local change with a remote:'never' or some other option and then have that change never go into the dirty (or destroyed) queues for later syncing.
(Now that I'm typing this, I think I just realized I need to do a custom parse maybe so that I can blank out that password before local save - so this might be a nonsensical case - but its an idea nonetheless.)
We were discussing this here: #12 (comment)
I had also said this, which you have just shown me was an incorrect assumption:
Accounting for that, what do you think about having a
storageMode: mode # one of: ['dual' (default), 'offline', 'remote-only', 'local-only']
I think those work ok. I can't think of a reason why I would use remote-only right now, but it makes sense for completeness. I think the names work fine if their use is documented.
I'm not sure I understand what offline is for?
I'm a little bit confused - would these used in conjunction with the "remote: false" or as a replacement? If a replacement, then I agree this is a better system - providing the decision can be made broadly at the model AND at the individual record save.
Again, I'm dealing with a weird edge case, so I hate to pollute the pool with that. But if there are other uses then making sure to have a local-only for completeness would help my case.
I will document the options regardless, but I hope to make the option names make sense without having to refer to documentation.
These would replace both the