-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hi, I don't know how how active this project is still but I've been learning about effects and I think it is a beguiling idea.
Most other libraries are too hard to understand , so I definably appreciate your work.
I think there is a small error in the examples where you forget the pass the continuation k as a argument to resume.
It should be something like this (from my limited understanding).
const withDataSource = handler({
getUser: (id,k) => eff(function* () {
const user = yield waitFor(() => fetchApi("users/" + id))
return yield resume(k,user)
}),
sendNotification: (options,k) => eff(function* () {
const { subscriber, user } = options;
const result = yield waitFor(() => fetchApi("users/" + subscriber.id + "/send", "POST", options))
return yield resume(k,result)
})
})
Metadata
Metadata
Assignees
Labels
No labels