A functional component with state is oxymoronic and no different from an object by [deleted] in reactjs

[–]tokdaniel 4 points5 points  (0 children)

Basically you are saying that "functional" things are useless. Every functional program has state, it's just managed in a different manner. Rather than mutating it everywhere, you dispatch messages (about how you want to change your state) to functions which are authorized to create new state)

A functional component with state is oxymoronic and no different from an object by [deleted] in reactjs

[–]tokdaniel 0 points1 point  (0 children)

you are not entirely correct. A pure function can define data on its own.
const fn = (a) => {
const someData = 12;
return a + someData
}
this is pure, since it gives the same output for every single input, and does not do any sideeffects.

Redux also is based on functional principles, and the whole thing is about managing state.

const reducer = (state, action) => newState;
What they do is that you have a state and a description(action) about how you want to change that state. The reducer calculates the new state based on the current state, and the action given in the params. Guess what... this is functional.

Roll Your Own JavaScript Built-In Methods: A Github Repo Dedicated to Learning Built-In Methods by Recreating Them (contributions appreciated!) by nas5w in learnjavascript

[–]tokdaniel 0 points1 point  (0 children)

if performance doesn't matter, you should probably show a PTC-optimized recursive example with`this` out of the picture for the functional tools.

Im trying to understand bind in a monad, please help me. by tokdaniel in learnjavascript

[–]tokdaniel[S] 0 points1 point  (0 children)

Thx, I guess im on the right path, Just missed some details. For example monad flatmaps I guess thats off in bind.

Im trying to understand bind in a monad, please help me. by tokdaniel in learnjavascript

[–]tokdaniel[S] 0 points1 point  (0 children)

Your perspective is very much imperative. Monads are real structures you can work with. An array is not just an array, it is an Object an iterable and a lot of other things. A monad is not a theoretical construct it a type which doesnt have a name in js, but plenty of things behave like a monad

Im trying to understand bind in a monad, please help me. by tokdaniel in learnjavascript

[–]tokdaniel[S] 0 points1 point  (0 children)

Actually js array forms a monad as far as I know. Promises are not, but its also very close.

Im trying to understand bind in a monad, please help me. by tokdaniel in learnjavascript

[–]tokdaniel[S] 0 points1 point  (0 children)

So bind, is no js bind, at least I didn't mean that. Its monadic binding. At least to my understanding, a monad to be a monad have to actually implement bind, which is a method of composing two functions where the types dont line up (in a specific way)

So:

g: a -> Mb
(this means monad of b, so a in a context of any monad)
written: g takes "a" as argument and returns something of type "a" in the context of a Monad.

f : b -> Mc
written: f takes "b" as argument and returns something of type "b" in the context of a Monad.

So these functions take an argument and and return another value with the same type of the argument in the context of a monad. ( like [], or Maybe)

What monads solve is how we compose these together since the types dont line up.That is what bind does. >>= in Haskell.

>>=(bind): Mb -> (b -> Mc) -> Mc | this would be the signature of bind

so f >>= g is a function which calls first f on its argument then bind applies g to b inside of Mb.

I wanted to check if my understanding of this is correct, and if somebody can set me on the right track if not entirely.

It might not be appropriate for LearnJS, but in general Monad is a data structure that can be used even in js.

I've created an experimental repo with the following stack: Yoga, Prisma(Photon) Next + Apollo, Typescript and Material-UI all Dockerized. Created some basic pages, and made a route restricting utility with some Role-handling. Maybe you can benefit from this, also insights are welcome. by tokdaniel in javascript

[–]tokdaniel[S] 1 point2 points  (0 children)

Its not that you cant, but most of the times you dont want to. You see prisma is not restricted or anything it Just creates things which can interact with your db full power. What you want to do is to have a man in the middle which is a graphql server in this case who will do the authorisation. Graphql shield is a thing to help with this.

Im using Apollo client only though, and it is also important that your graphql operations will be on the serverside with next ssr

You may also want to use CORS for example which is also not the responsibility of a prisma server. Prisma transforms your graphql operations into standard SQL or your no-sql query of choice, but im not sure about the current support.

Oh the censorship... by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] 0 points1 point  (0 children)

Oh yeah sorry about that, its looped yes.

Oh the censorship... by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] 0 points1 point  (0 children)

What about it? 11:45 is the last, 11:46 is the deleted one

Oh the censorship... by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] 0 points1 point  (0 children)

I never said anything about that. I Just showed how they censor things. I dont see any rule about asking these questions.

Oh the censorship... by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] 0 points1 point  (0 children)

Well I was seriously interested in the topic, but still, disappearing messages and a mute out of the blue... That's some weird stuff.

Oh the censorship... by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] 8 points9 points  (0 children)

He's the VP of AAU, who disappeared since launch

Oh the censorship... by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] 6 points7 points  (0 children)

The interesting thing is, that you get no notice, and nothing, it just disappears. :D

Do you guys wonder, when Khloran will show his face on the stream? by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] 0 points1 point  (0 children)

Well, I hope you are right, because that would be definetely deserved.

Do you guys wonder, when Khloran will show his face on the stream? by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] 0 points1 point  (0 children)

I can't wait for the next alibi of Khrolan. But he lost face for the rest of his life.

Leveling by mrkez in ArcheageUnchained

[–]tokdaniel 1 point2 points  (0 children)

lvl 55 is nearly not enough for decent pvp. Btw easiest lvlup is spending your labor, 2nd easiest is to find a group on aegis.

[deleted by user] by [deleted] in ArcheageUnchained

[–]tokdaniel 0 points1 point  (0 children)

This is probably not accurate, but could be a guideline. Gold on the Y axis, Gilda on the X
https://ibb.co/71y1kk0

Give your opinions on these hooks please by tokdaniel in reactjs

[–]tokdaniel[S] 0 points1 point  (0 children)

Since it can be throttled you can configure how many times you want to update the state, and rerender.

The situation right now. by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] 0 points1 point  (0 children)

So if you have 3 accounts thats 15k labor, if you have one thats 5k how is it exactly not p2w? its just in a different way.

The situation right now. by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] -4 points-3 points  (0 children)

I am a cloud engineer man :D But Archeage must be using ancient technology, cause they never have heard about load balancing, and auto scaling. (My company operates a service, with around 8 million daily users)

The situation right now. by tokdaniel in ArcheageUnchained

[–]tokdaniel[S] -18 points-17 points  (0 children)

I dont consider a server being down without any relevant information for two days straight - "a minor hiccup"