Skip to content

Example results in "Missing continuation parameter in resume" error #4

@wrnrlr

Description

@wrnrlr

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions