1
2
3
submitted 2 weeks ago* (last edited 2 weeks ago) by to c/react@programming.dev
 
 

A fairly unique approach to state management using encrypted asynchronous state updates.

It is not production-ready. I'm working on it to use in my own projects. It isn't reviewed or audited by a third-party, so I can't recommend you use it in your own code. Sharing for testing and demo purposes only.

TLDR; The title of this post.

Feel free to reach out for clarity instead of reading the code/docs.

I was working on “react-like syntax for webcomponents”. I started off with an approach for asynchronous state management so that components outside the shadow-root could receive updates. (The events are also encrypted to secure against things like browser extensions.)

https://positive-intentions.com/docs/projects/dim/async-state-management

It then made sense to be able to persist that data so it can work between page releoads.

https://positive-intentions.com/docs/projects/dim/bottom-up-storage

The result looks and works like the following when used in a project.

https://positive-intentions.com/docs/projects/dim/encrypted-store

The Dim framework seems like a dead-end. I wanted to try the hook out on my existing React projects. So I created the equivalent React hook.

https://positive-intentions.com/docs/projects/dim/use-dim-store-react

I find it to be performant and I want to push the scale of the approach, so I am in the process of testing it out on my projects. A notable use-case there is storing encrypted files at rest.

Feel free to reach out for clarity.

4
5
6
7
8
9
10
11
 
 

I'm learning React and working on my first course project, a CV generator app. I created an initial state - snippet below - which I normalized to an extent. The professional experience field has an Employer + the employer related data (employment dates, position etc.).

I'm encountering two problems with the current structure:

  • the Achievements section of each employer, which has a few subpoints, is in the same place as the company data. I can programatically select only the needed fields to display, but I was wandering if there is a better structure that I'm missing
  • when I add a second, third... employer, all their company data goes in the same place. Again, I can retrieve only what I need based on id, but I was wondering if there is a semantically better choice
const initialPerson = {
  employers: {
    byIds: {
      "employer-1": {
        id: "employer-1",
        name: "Company",
        value: "Test Org 1",
        cdataIds: ["cdata-1", "cdata-2", "cdata-3", "cdata-4", "cdata-5", "cdata-6"],
      },
      // other employers follow 
    },
    allIds: ["employer-1"],
  },
  companyData: {
    byIds: {
      "cdata-1": {
        id: "experience-1",
        name: "Position",
        value: "Test Engineer 1",
      },
      "cdata-2": {
        id: "exp-2",
        name: "Duration",
        value: "Jan. 2025 - Present",
      },
      "cdata-3": {
        id: "exp-3",
        name: "Location",
        value: "Brussels, Belgium",
      },
      "cdata-4": {
        id: "exp-4",
        name: "Achievement",
        value: "STAR: Situation Task Action Result"
      },
      "cdata-5": {
        id: "exp-5",
        name: "Achievement",
        value: "XYZ: Accomplished X as measured by Y by doing Z",
      },
      "cdata-6": {
        id: "exp-6",
        name: "Achievement",
        value: "CAR: Challenge Action Result",
      },
    },
    // data from all employers goes here
    allIds: ["cdata-1", "cdata-2", "cdata-3", "cdata-4", "excdatap-5", "cdata-6"],
  },
}
12
13
14
15
16
17
18
19
 
 

Our @nickschot shares how to integrate @react and @emberjs on our blog, based on learnings from a number of multi-framework projects our team did recently. If you’re looking to mix frameworks and face challenges, reach out.

➡️ https://mainmatter.com/blog/2025/12/12/react-ember/

#react #emberjs

20
21
22
23
24
Why use React? (adactio.com)
25
view more: next ›