Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iniz MVP #127

Closed
13 of 15 tasks
IniZio opened this issue Nov 30, 2021 · 2 comments
Closed
13 of 15 tasks

Iniz MVP #127

IniZio opened this issue Nov 30, 2021 · 2 comments

Comments

@IniZio
Copy link
Owner

IniZio commented Nov 30, 2021

What reim should aim to be

Reliably handles all state outside API interactions

GraphQL clients have evolved rapidly and in my own projects I pretty much use them for all interactions except for primitive components and some parts of the feature that data should prioritize local more than API

I noticed that there have been increased number of headless ui libraries, but quite some of them do not handle logics at all. See if this library can solve this

Ideas

Remove immer from dependency

Immer is nice, but not a necessary dependency for this library to fulfill its goal

Can store state machine alongside data

State machine is useful in UI specific logics since same action should do different stuff under different context. An example would be triggering a "type something" action in edit mode vs readonly mode. Note that a single state is often not that useful since you can be in a stage of edit mode or maybe syncing in collaboration mode in parallel. Tried xstate before but it's pretty painful

Tasks

  • Handle Atom in atom and non-atom in useAtom
  • Fix dispose effect for react (Currenly use workaround by forcererender on dispose)
  • rename effect to watch and add usewatch Keep effect and use useSideEffect instead
  • Support wrapping atom and useAtom over-and-over again
  • Add batch update
    • Should error if batch level goes too high, because it's probably due to infinite loop
  • Fix currentObserver must use settimeout when unassign in react effect (Actually this kind of make sense since need a render cycle to collect the dependencies?)

    Might be that the effect in useatom is not actually wrapping the scope of atom effect?

  • eslint
  • Extract marker logic from useAtom
  • Ci/cd
  • setup tests
  • Allow scoping atom change in part of a component's render tree #135
    e.g.
     <Atom atom={form.value.username}>
       {control => <input onChange={e => control.v = e.target.value} value={control.v} />}
     </Atom
  • See if can handle promise / future #136
  • See if can handle Map/Set #137
  • Make preact version? #138
@IniZio
Copy link
Owner Author

IniZio commented Sep 29, 2022

Apparently I removed the npm organization by accident so will have to create a new name for this package...

Using iniz for now...

@IniZio IniZio changed the title [Draft] Version 4 [WIP] Version 4 Oct 4, 2022
@IniZio IniZio changed the title [WIP] Version 4 [WIP] Iniz Oct 7, 2022
@IniZio
Copy link
Owner Author

IniZio commented Oct 9, 2022

Will be creating separate issues for remaining features, want to prioritize documentation first

@IniZio IniZio changed the title [WIP] Iniz Iniz MVP Oct 9, 2022
@IniZio IniZio closed this as completed Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant