{"id":15103452,"url":"https://github.com/i-cell-mobilsoft-open-source/tinystate","last_synced_at":"2026-01-18T22:33:49.068Z","repository":{"id":232824112,"uuid":"644760305","full_name":"i-Cell-Mobilsoft-Open-Source/TinyState","owner":"i-Cell-Mobilsoft-Open-Source","description":"Simple \u0026 Tiny library for state managemant in Angular applications","archived":false,"fork":false,"pushed_at":"2023-10-30T12:24:42.000Z","size":241,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-05T11:45:28.136Z","etag":null,"topics":["angular","angular2","state-management","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-Cell-Mobilsoft-Open-Source.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-24T07:46:11.000Z","updated_at":"2024-04-11T14:20:53.000Z","dependencies_parsed_at":"2024-04-11T17:29:42.443Z","dependency_job_id":"0712073e-97ff-4d77-b3ba-4b228afe18ca","html_url":"https://github.com/i-Cell-Mobilsoft-Open-Source/TinyState","commit_stats":null,"previous_names":["i-cell-mobilsoft-open-source/tinystate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-Cell-Mobilsoft-Open-Source%2FTinyState","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-Cell-Mobilsoft-Open-Source%2FTinyState/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-Cell-Mobilsoft-Open-Source%2FTinyState/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-Cell-Mobilsoft-Open-Source%2FTinyState/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-Cell-Mobilsoft-Open-Source","download_url":"https://codeload.github.com/i-Cell-Mobilsoft-Open-Source/TinyState/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332545,"owners_count":20921853,"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":["angular","angular2","state-management","typescript"],"created_at":"2024-09-25T19:24:11.680Z","updated_at":"2026-01-18T22:33:49.062Z","avatar_url":"https://github.com/i-Cell-Mobilsoft-Open-Source.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tiny State Service\n\nTiny State Service is a TypeScript library for managing state in Angular applications. It provides decorators for defining state handlers, selectors, and selected properties, as well as a service for managing state and persisting it to a storage mechanism.\n\n## Installation\n\nTo install Tiny State Service, run the following command:\n\n```bash\nnpm install @i-cell/tiny-state\n```\n\n## Usage\n\nTo use Tiny State Service in your Angular application, follow these steps:\n\n1. Import the `TinyStateService` from `@tiny-state/core` and add it to your application's providers.\n2. Define a state handler using the `TinyHandler` decorator.\n3. Define a selector using the `TinySelector` decorator.\n4. Define a selected property using the `TinySelect` decorator.\n5. Use the `TinyStateService` to get and set state.\n\n## API\n\n### `TinyHandler(persist?: boolean | Storage, type?: new () =\u003e T)`\n\nDecorator for defining a state handler.\n\n- `persist` (optional): Whether to persist the state to a storage mechanism. If true, the state will be persisted to localStorage. If a Storage object is provided, the state will be persisted to that storage mechanism. Defaults to false.\n- `type` (optional): The type of the state object. If provided, the state object will be created using the new operator with this type. Defaults to Object.\n\n### `TinySelector(path?: string)`\n\nDecorator for defining a state selector.\n\n- `path` (optional): The path inside the state object to select. Uses lodash's get function to select the value. Defaults to undefined.\n\n### `TinySelect(fn: Function)`\n\nDecorator for defining a selected property.\n\n- `fn`: A function that returns the selected value.\n\n### `TinyStateService`\n\nA service for managing state and persisting it to a storage mechanism.\n\n#### `getState(stateHandler: any)`\n\nReturns the state object for the given state handler.\n\n#### `getStoreMap(stateHandler: any)`\n\nReturns the store map for the given state handler.\n\n#### `createStore(identifier: string | symbol, value: any)`\n\nCreates a new store with the given identifier and value.\n\n#### `storeSelector(stateHandler: any, identifier: string | symbol, value: any)`\n\nStores a selector with the given identifier and value for the given state handler.\n\n#### `storeSelectorSubject(stateHandler: any, identifier: string | symbol, subject: any)`\n\nStores a selector subject with the given identifier and subject for the given state handler.\n\n#### `getSelectorSubject(stateHandler: any, identifier: string | symbol)`\n\nReturns the selector subject for the given identifier and state handler.\n\n#### `getSelector(stateHandler: any, identifier: string | symbol)`\n\nReturns the selector for the given identifier and state handler.\n\n#### `hasSelector(stateHandler: any, identifier: string | symbol)`\n\nReturns true if the given state handler has a selector with the given identifier.\n\n#### `initState(stateHandler: any)`\n\nInitializes the state for the given state handler.\n\n#### `checkStateHandler(stateHandler: any): boolean`\n\nReturns true if the given object is a TinyStateHandler and is not already in use.\n\n#### `addStateHandler(stateHandler: any)`\n\nAdds the given state handler to the service.\n\n#### `getInstance()`\n\nReturns the singleton instance of the TinyStateService.\n\n#### `persist(stateHandler: any, state: any)`\n\nPersists the state to a storage mechanism.\n\nLicense MIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-cell-mobilsoft-open-source%2Ftinystate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-cell-mobilsoft-open-source%2Ftinystate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-cell-mobilsoft-open-source%2Ftinystate/lists"}