Closed staltz closed 8 years ago
When ready, use in TodoMVC-Cycle
Hi @staltz I am interested in this feature. Would be happy to help. Do you want to write this from scratch or maybe driverize this: https://github.com/nramadas/Storable? (to which @highondrive pointed me to in Gitter)
Might be a good first task to help. Check out how TodoMVC-Cycle has a small local-storage driver.
Ok will have a look at that. Thanks.
@staltz this is how I understood your Draft API: https://github.com/kahlil/cycle-storage-driver can you have a quick look and let me know if I am on the right track before I go ahead and add tests and stuff?
It's just a few lines of code.
Overall looks good, although I'd change this signature
doAction(target = 'local', action = 'setItem', key = undefined, value = undefined)
to
doAction(key, value, target = 'local', action = 'setItem')
Because if you call doAction('fooAge', 30)
, then we should assume the defaults target = 'local'
and action = 'setItem'
, but the first signature wouldn't do that, it would take target= 'fooAge'
and action = 30
.
OK will do, thanks.
Should I refactor the function to take an object instead of params since the cycle linter does not like 4 params?
Perhaps yes
OK @staltz I think code-wise this is done: https://github.com/kahlil/cycle-storage-driver, please let me know if something needs to be changed. It is currently also published on npm as cycle-storage-driver
.
I still need to write the Readme.
@staltz to my understanding this is done. See: https://github.com/kahlil/cycle-storage-driver/
Let me know if anything needs to be changed.
Can this issue be closed?
Yes
:smile:
I don’t think it’s working as it ought to. See this issue https://github.com/cyclejs/cycle-storage-driver/issues/7
Draft API:
where
request$
is an Observable ofrequest
objects, following the template:Defaults are set as
'local'
fortarget
, and'setItem'
foraction
.responseCollection
is a queryable collection of Observables, following the template: