{"id":13701381,"url":"https://github.com/threepointone/freezus","last_synced_at":"2025-07-20T15:02:42.198Z","repository":{"id":66100083,"uuid":"121116857","full_name":"threepointone/freezus","owner":"threepointone","description":"magic component for transitions between screens","archived":false,"fork":false,"pushed_at":"2018-05-30T10:50:35.000Z","size":173,"stargazers_count":182,"open_issues_count":0,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-02T04:11:40.815Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/threepointone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-11T11:31:15.000Z","updated_at":"2025-03-07T02:38:15.000Z","dependencies_parsed_at":"2023-04-27T14:47:30.490Z","dependency_job_id":null,"html_url":"https://github.com/threepointone/freezus","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/threepointone/freezus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threepointone%2Ffreezus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threepointone%2Ffreezus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threepointone%2Ffreezus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threepointone%2Ffreezus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threepointone","download_url":"https://codeload.github.com/threepointone/freezus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threepointone%2Ffreezus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266143941,"owners_count":23883069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T20:01:34.364Z","updated_at":"2025-07-20T15:02:42.173Z","avatar_url":"https://github.com/threepointone.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## freezus\n\n[work in progress]\n\n[ost](https://soundcloud.com/sahandii/cold-as-ice-remake)\n\n`yarn add freezus`\n\n```jsx\nimport Transition from 'freezus'\n\n// ...\n\n\u003cTransition\n  id={key} // change this for every transition\n  onEnter={async function*() =\u003e ...}\n  onExit={async function*() =\u003e {\n    // do whatever!\n    // the previous render sticks around until this function exits\n    // and by magic, redux state is frozen inside it!\n    // local state and everything else works as expected\n\n    // you can now manually animate that old element out,\n    // do a shared element transition, whatever.\n    // use jquery for all I care\n    // refs are doubly useful here :)\n  }}\u003e\n  \u003cSomeContent/\u003e\n\u003c/Transition\u003e\n```\n\n## rationale\n\n* traditionally, by rendering a new view in a position, we implicitly destroy the previous view (if it was different)\n* alternately, we have to manually maintain ui state, mixing our animation concerns with business logic.\n* `\u003cTransition/\u003e` abstracts that for you\n\n## how does it work\n\n* fragments to render multiple phases at once\n* lifecycle - onEnter, onExit\n* cancellable\n* freeze redux state for the subtree\n\n## cancellation\n\nasync generators handle cancellation pretty nicely\n\n```jsx\nonExit={async function*() =\u003e {\n  try{\n    await sleep(1000)\n  }\n  finally {\n    const isCancelled = yield;\n    // do the thing\n  }\n}}\n```\n\n## state\n\nby combining `reduce` and the `yield`s from `onEnter`/`onExit`, you can\nimplement a redux-like pipeline to manage state. the default reducer is\n`(x, y) =\u003e y` i.e. - it saves the last action as the state. You can read\nfrom this state with `Transition.Consumer`\n\n```jsx\n[todo];\n```\n\ntodo -\n\n* examples\n* tests\n* freeze react-router\n* freeze anything on context\n* `\u003cReactTransition` that matches the [popular one](https://reactcommunity.org/react-transition-group/), good for migrating\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreepointone%2Ffreezus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreepointone%2Ffreezus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreepointone%2Ffreezus/lists"}