jamesplease / jamesplease/hsm.js

State state demarcation

Open
#10 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
12
Forks
0
PR merge metrics
No merged PRs in 30d

Description

"Wat?"

So this thing was built to re-create a router like the one that Ember provides. One feature of Ember's router is that states themselves can have unique state. This might seem crazy, but lets consider the following state, `books/book`. The route for this state might be `books/:bookId`.

This state can have any number of unique states based on what ID is passed to it. For instance, `books/2` is distinct from `books/3`. Therefore, if a user goes from `books/2/authors` to `books/3/authors`, it should reload that book. Right now, hsm will just say, 'nothing has changed' for the `books/book` state, which is inaccurate.

The same problem happens if you were to transition between different child states, like `books/3/authors` to `books/2/comments`. It should realize that the second state's 'state' is different, and that things need to be set up again.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named. Start by tracing how hsm compares the current and target states during transitions, using books/2/authors to books/3/authors and books/3/authors to books/2/comments as cases. Done means distinct route parameters cause the affected state and its children to be set up again.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.