
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@jvlk/fp-ts-remote-data
Advanced tools
A library to make it easy to work with remote data. Compatible with the fp-ts
ecosystem, but it's not required.
RemoteData represents a value that can be in one of four states:
import * as D from '@jvlk/fp-ts-remote-data'
import { pipe } from 'fp-ts/function'
import useBlogRequest from './useBlogRequest'
import Loading from './Loading'
import Error from './Error'
import Empty from './Empty'
import Blog from './Blog'
function Component() {
const blog = useBlogRequest()
return pipe(
blog,
D.fold(
() => <Loading />),
err => <Error error={err}>,
() => <Empty/>,
entries => <Blog entries={entries}>
)
}
Using NPM:
npm i @jvlk/fp-ts-remote-data
Using Yarn:
yarn add @jvlk/fp-ts-remote-data
The start of this repo began as a clone of https://github.com/sylcastaing/fp-ts-remote-data. I have modified it and diverged from it. That library is much more "sound" from a fp-ts
types perspective, but I wanted to create something that was focused more on developer usability. I've removed many of the functions in favor of simplifying things. I have also added the 4th state of empty
to avoid having to use a value of Option
if the results don't contain any data.
The original concept of the RemoteData type comes from How Elm Slays a UI Antipattern.
FAQs
An fp-ts library to make it easy to work with remote data.
We found that @jvlk/fp-ts-remote-data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.