aptonic / dropzone4-actions

Add-on actions and API Docs for Dropzone 4
https://aptonic.com
363 stars 57 forks source link

How to remove value? #69

Closed graycreate closed 8 years ago

graycreate commented 8 years ago

Hi raguay, I want to remove a value sometimes, I tried dz.save_value('key', '') , but it doesn't work! Is there a method like dz.remove_value(key)?

Best regards!

raguay commented 8 years ago

Hi,

There isn't anyway to remove a saved value. Therefore, if you want to see if a value has been saved, then deleted, set it to a not interesting value, like '-'. Then set your code to check for the environment variable existing (because it will not exist until the first time you set it) or is set to the blank value like '-'. If either is true, it hasn't been set (or was deleted). The API is assuming you will never want to remove a saved value, but it's just as easy to set to a value that means "not set" to that program.

graycreate commented 8 years ago

Ok , That's what I did for now.