Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more updates for outcome rework

  • Loading branch information...
commit 60b6fb6221cdf0c44d1bb18275c8a40c2f717fd9 1 parent 4079943
@cloudshift authored
View
11 cloudshift/data/Sqlite3Bucket.hx
@@ -208,8 +208,15 @@ class Sqlite3Bucket<T> implements Bucket<T> {
}
public function delete(o:T):Outcome<String,T> {
- var prm = Core.outcome();
- deleteByOid(Data.oid(o)).deliver(prm.resolve);
+ var prm:Outcome<String,T> = Core.outcome();
+ deleteByOid(Data.oid(o)).deliver(function(e:Either<String,Int>) {
+ switch(e) {
+ case Right(i):
+ prm.resolve(Right(o));
+ case Left(err):
+ prm.resolve(Left(err));
+ }
+ });
return prm;
}
View
4 usage/data/RemoteClient.hx
@@ -8,7 +8,7 @@ using cloudshift.Mixin;
class RemoteClient {
public static function main(){
- Data.store(REMOTESQLITE("http://localhost:8082/data")).good(function(store) {
+ Data.store(REMOTESQLITE("http://localhost:8082/data")).outcome(function(store) {
store.bucket("woot").outcome(function(woot) {
woot.where('name="lore"').outcome(function(recs) {
@@ -21,7 +21,7 @@ class RemoteClient {
});
});
- store.hash("peeps").good(function(peeps) {
+ store.hash("peeps").outcome(function(peeps) {
peeps.set("me",{email:"lorena@ritchie.com",name:"lore",passwd:"and why not"})
.outcome(function(p) {
peeps.get("me").outcome(function(me) {
View
2  usage/data/RemoteSource.hx
@@ -9,7 +9,7 @@ class RemoteSource {
public static function main(){
Http.server().root("www").start({host:"localhost",port:8082}).outcome(function(http) {
- Data.store(SQLITE("test.db")).good(function(store) {
+ Data.store(SQLITE("test.db")).outcome(function(store) {
store.bucket("woot").outcome(function(woot) {
woot.indexer("name",function(o:Dynamic) {
return o.name;
Please sign in to comment.
Something went wrong with that request. Please try again.