onflow/flip-fest

FCL Feature: Simplify `currentUser` syntax

Closed this issue ยท 1 comments

๐Ÿ‘‹   If you are interested in working on this issue, please check out the Getting Started guide on HackerEarth!

Description (Problem Statement)

Simplify the syntax of the fcl.currentUser function into a class or object.

Experience Required (Team Required)

  • JS and familiarity with FCL fcl.currentUser

Minimum Feature Set (Acceptance Criteria)

  • Upon successful completion the following should be true:
import {currentUser} from "@onflow/fcl"

// before
currentUser().subscribe(callback)
// after
currentUser.subscribe(callback)

// before
currentUser().snapshot()
// after
currentUser.snapshot()

// before
currentUser().authenticate
// after
currentUser.authenticate

// before
currentUser().authorization
// after
currentUser.authorization

// before
currentUser().asArg
// after
currentUser.asArg

Milestone Requirements

  • Update fcl.currentUser() from function to Class or Object syntax
  • Add/Update tests
  • Update Documentation - Add a description for this feature including sample code for usage in the existing API Docs

Software Requirements

  • Code should be written with best practices in mind.
  • Other Requirements - Error Reporting
    • Throw descriptive exceptions on errors
    • Prints a clear error message to the browser console
  • All core logic should have unit tests. Include tests for success on valid data and failure

Other Requirements

  • Updated Documentation describing the code, and usage

Judging Criteria

Resources

Hello folks! I'm Greg ๐Ÿ‘‹๐Ÿผ ๐Ÿ˜Ž A Senior Javascript Developer on the DevEx Team.
If you choose this issue, I'll be your primary Point of Contact for any questions on implementation, code reviews, and/or help getting it over the finish line. Thanks for participating and Good Luck!