How fast loggedInUser() function is?

I have some UI elements that depends on current user.

Should I use loggedInUser() function every time or it's better to have it saved within load() function and passing as a parameter into inner rules?

  Discussion posts and replies are publicly visible

Parents
  • I like how   explains it.:
    In general, smart reuse of load variables is an important design practice to be mindful of as unnecessary reevaluation of the same expression or function comes with a cost.

    Another common offender is over use of fn!isUserMemberOfGroup(). This function can get expensive when it's overused - if a design has this in multiple sections on the same interface, or multiple interfaces in the same process, it might be a good idea to consider how you can test for this early, once, and retain the answer for later use.

Reply
  • I like how   explains it.:
    In general, smart reuse of load variables is an important design practice to be mindful of as unnecessary reevaluation of the same expression or function comes with a cost.

    Another common offender is over use of fn!isUserMemberOfGroup(). This function can get expensive when it's overused - if a design has this in multiple sections on the same interface, or multiple interfaces in the same process, it might be a good idea to consider how you can test for this early, once, and retain the answer for later use.

Children
No Data