16 questions
1
vote
1
answer
137
views
What does it mean that in Fluture fork should be used in one place?
I was reading about Fluture, and one way to consume a Future is to call fork. That is all understandable so far but in documentation it states:
"Generally, one only needs to call fork in a single ...
1
vote
1
answer
541
views
Fluture: converting a future back to a promise for express global error handling
I am trying to find a way to convert a Promise to a future using the fluture library to implement functional programming, transform the data using a functional pipeline, then transform back to a ...
1
vote
1
answer
111
views
Fluture: how should null handling get addressed using Monads
I am new to functional programming and I found the following fluture functional programming example that seems to give a really good example for handling database queries and subsequent data ...
0
votes
1
answer
130
views
Creating a composePipe function for Futures from Fluture
I wanted to make a compose function for piping and im stuck. I managed to make a pointfree pipe but cant figure out composing.
// pointfree
const pipe = fn => future => future.pipe(fn)
// ...
0
votes
1
answer
344
views
how do I consume a future from a resolved fetch request?
I am using the coinbase dev API to access assets.
To access rates data requires an access key which the API sends back from a POST request.
I am using Flutures and a module called Fetch-Futures ...
2
votes
1
answer
248
views
Railway Oriented Programming with Fluture
Railway Oriented Programming(ROP) is explained here:
https://fsharpforfunandprofit.com/rop/
Is there any way to use this pattern with Fluture
I can do ROP with these two helper methods like this:
...
0
votes
1
answer
302
views
execute Fluture task with Sancuary Either
I have a pipe like this
const asyncFn = (x) => {
return Future.tryP(() => Promise.resolve(x + ' str2'))
};
const pipeResult = S.pipe([
x => S.Right(x + " str1"), // some validation ...
1
vote
1
answer
408
views
Execute Fluture task in middle of Sanctuary pipe
I have a pipe like this:
S.pipe([
getRequestFile, // not async
S.chain(saveTemporary), // not async
S.chain(copyImageToPublicPath), // async
S.chain(...
0
votes
0
answers
98
views
Using Fluture with AWS Service
I'm using a fluture to handle the response from an AWS service request.
I get the expected response using a callback or a Promise wrapped around the callback. When I try to use a fluture, looks like ...
1
vote
1
answer
164
views
UnhandledPromiseRejectionWarning when using Fluture `encaseP` on `fetch`
I have just started using Flutures, and I am trying to fetch some remote data for a visualization with d3.
I created a function which accepts a DOM selector (e.g. #my-chart) and a url (e.g. https://...
2
votes
1
answer
303
views
How to log properly in Sanctuary / Fluture?
Background
I have a function, called logInfoAsync. Let's consider this function sends some information to a log server over the network. For the purposes of this question let's assume the function is ...
1
vote
2
answers
856
views
Fluture bimap and fold, what is the difference and when should I use them?
Background
I am using Fluture to abstract Futures.
Let's say I have a function that makes a GET request. This function can succeed or fail.
Upon making a request, if it succeeds, it prints a ...
2
votes
2
answers
286
views
How to stub Fluture?
Background
I am trying to convert a code snippet from good old Promises into something using Flutures and Sanctuary:
https://codesandbox.io/embed/q3z3p17rpj?codemirror=1
Problem
Now, usually, ...
3
votes
2
answers
440
views
Convert Fluture Future to folktale Result
I have the following sample code to fetch a uuid:
const Result = require('folktale/result')
const Future = require('fluture')
Future.prototype.flatMap = Future.prototype.chain
const fetch = Future....
3
votes
1
answer
157
views
Can somebody tell me what is the difference between Task and Future concurrent action? Because the interface looks the same
// in using Task based on the fun-task library
Task.create((res, rej) => res(5)).run({
success: console.log,
failure: console.error
});
// 5
// using Future through Fluture
Future((reject, ...