You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Really having a good time with this soon to be "real" project 😂 made a wrapper around fetch https://github.com/davidchase/yet-another-fetch which somewhat works the way I want but wanted to get some thoughts..
To put it into words: An fmapped FutureValue of a is a FutureValue of an fmapped a. In the example you gave, a is type Array Int. So:
fmap f (FutureValue (Array Int)) = FutureValue (fmap f (Array Int))
Which applies f to each element of the array. Make sense?
I'm planning to add other functions that will allow access to the value as a whole (e.g. you could console.log the whole array rather than one item at a time, if you wanted), but I'm kinda digging this type class morphism approach for certain type classes, like Functor in the case of map, and probably at least Applicative and Monoid as well.
really digging the ability to kill off a task especially with fetch because i can prevent the request from happening altogether
Really having a good time with this soon to be "real" project 😂 made a wrapper around fetch https://github.com/davidchase/yet-another-fetch which somewhat works the way I want but wanted to get some thoughts..
currently with
yet
:i think the expected should be the
[1, 2, 3]
list?I first noticed it with yet-another-fetch because
futureValue.map(console.log)
was logging a value instead of anEither
From what i gather the culprit is
F.map
and it does the check for if x has map and then uses ithttps://github.com/briancavalier/yet/blob/master/src/FutureValue.js#L52
https://github.com/briancavalier/yet/blob/master/src/FutureValue.js#L67
my current workaround is just to do
f(future.value)
andthis.f(value)
respectively so maybe we don't need to useF.map
in that case... thoughts?really digging the ability to kill off a task especially with fetch because i can prevent the request from happening altogether 👍
The text was updated successfully, but these errors were encountered: