Xstate: [Hacktoberfest] Memoization of properties!

Created on 3 Oct 2018  路  4Comments  路  Source: davidkpiano/xstate

Bug or feature request?

Enhancement

Description:

For Hacktoberfest, I would love help adding a memoization decorator to certain computed get properties in StateNode, such as:

  • .definition
  • .config
  • .on
  • .after
  • .tree
  • .delays
  • .resolvedStateValue
  • .initialStateValue
  • .initialState
  • etc.

For some properties, caching is already done in an ad-hoc way (e.g., with __cache and idMap) but there's definitely better ways to do this.

(Feature) Potential implementation:

Take a look at something like typescript-memoize to guide you.

help wanted

Most helpful comment

Is this issue already done @davidkpiano ?
In case it's not done, I'd like to take it.

All 4 comments

Is anyone working on this? I'd like to pick it up if it's available :)

@tarsir It's yours if you want it! Would love the help.

Is this issue already done @davidkpiano ?
In case it's not done, I'd like to take it.

@ivanportillo It's not done yet, feel free to take it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carloslfu picture carloslfu  路  3Comments

doup picture doup  路  3Comments

hnordt picture hnordt  路  3Comments

greggman picture greggman  路  3Comments

dakom picture dakom  路  3Comments