Skip to content

New Core

Latest
Compare
Choose a tag to compare
@lxsmnsyc lxsmnsyc released this 17 Apr 15:25
· 14 commits to main since this release

graph-state

  • Deprecation of the ff. functions:
    • createGraphDomainMemory -> createMemory
    • createGraphNode -> node
    • createGraphNodeFactory -> factory
    • getGraphNodeState -> get
    • runGraphNodeDispatch -> dispatch
    • runGraphNodeCompute -> reset
    • hydrateGraphNodeState -> hydrate
    • setGraphNodeState -> set
    • subscribeGraphNode -> subscribe
    • destroyGraphDomainMemory -> destroyMemory
    • hasGraphNode -> exists
    • getGraphNodeVersion -> version
    • createGraphNodeResource -> resource
    • createGraphNodeResourceFactory -> resourceFactory

Use of these old function names are still supported, but marked as @deprecated.

  • GraphNodeGetInterface and GraphNodeSetInterface has been renamed to GraphNodeContext
  • nodes with custom set defined can now return any value. With this change, set is no longer subject to race conditions. It is recommend to use subscription to work-around this problem.
  • mutate, mutateSelf and set can now accept derived states (callbacks that receives the previous state and returns the new state).
  • Added subscription to set context. Subscriptions are cleaned-up every time set is dispatched.
  • node hydration no longer runs the initial computation before setting the hydration value.
  • Removed type declarations for context fields. They are now defined directly in the field.
  • Renamed most types.
  • Updated README

react-graph-state

  • Update README
  • Migrated core to react-store-adapter and react-scoped-model
  • Added useGraphNodeSelector

preact-graph-state

  • Update README
  • Migrated core to preact-store-adapter and preact-scoped-model
  • Added useGraphNodeSelector

swr-graph-state

  • Migrated core to swr-store
  • Removed fetch option in favor of the new setup option.
  • Removed hydrate
  • Deprecated the ff.
    • createSWRGraphNode -> swr
    • createSWRGraphNodeFactory -> swrFactory