Skip to content

Use result of Future #516

@MalQaniss

Description

@MalQaniss

If I wanted to use value returned by future to lets say display it on body element, would I do that in fork function like this:

const toJson = response => attemptP(() => response.json())

const germany = attemptP(() => fetch('https://restcountries.com/v3.1/name/germany'))
    .pipe(chain(toJson))
    .pipe(fork(setBodyText('Not Found'))(setBodyText))

Or is there some way to store a value returned by the fork function similar to how promises have "await"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions