{"id":17936521,"url":"https://github.com/terzurumluoglu/ng-memento","last_synced_at":"2025-12-28T19:08:43.169Z","repository":{"id":257827499,"uuid":"870337660","full_name":"terzurumluoglu/ng-memento","owner":"terzurumluoglu","description":"an angular library for caching api request","archived":false,"fork":false,"pushed_at":"2024-10-31T10:43:17.000Z","size":137,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T21:06:01.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/terzurumluoglu.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-09T21:21:18.000Z","updated_at":"2025-01-07T14:11:32.000Z","dependencies_parsed_at":"2024-10-23T12:05:14.165Z","dependency_job_id":null,"html_url":"https://github.com/terzurumluoglu/ng-memento","commit_stats":null,"previous_names":["terzurumluoglu/ng-memento"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terzurumluoglu%2Fng-memento","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terzurumluoglu%2Fng-memento/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terzurumluoglu%2Fng-memento/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terzurumluoglu%2Fng-memento/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terzurumluoglu","download_url":"https://codeload.github.com/terzurumluoglu/ng-memento/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245067133,"owners_count":20555505,"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-10-28T22:01:29.500Z","updated_at":"2025-12-28T19:08:43.156Z","avatar_url":"https://github.com/terzurumluoglu.png","language":"TypeScript","funding_links":[],"categories":["Architecture and Advanced Topics"],"sub_categories":["HTTP"],"readme":"# NgMemento\n\nng-memento makes your application faster by preventing the same http requests from being called again in your Angular project.\n\n## Installation\n\n```bash\nnpm i ng-memento --save\n```\n\n## Demo\n\n### Example\n\nThe application was built by using this library. [Visit](https://ng-memento-web.onrender.com/users)\n\n### Image\n\n![til](https://ng-memento-web.onrender.com/assets/demo.gif)\n\n## Stable Versions\n\n| Angular version | ng-memento version |\n| :-------------- | :----------------- |\n| `v13.x.x`       | `v3.x.x`           |\n| `v14.x.x`       | `v4.x.x`           |\n| `v15.x.x`       | `v5.x.x`           |\n| `v16.x.x`       | `v6.x.x`           |\n| `v17.x.x`       | `v7.x.x`           |\n| `v18.x.x`       | `v8.x.x`           |\n| `v19.x.x`       | `v9.x.x`           |\n| `v20.x.x`       | `v10.x.x`          |\n\n## Documentation\n\n### How can I use?\n\n```typescript\nimport { NgMementoModule, IMementoConfig } from \"ng-memento\";\n\nconst config: IMementoConfig = {\n  expireTimeAsMilliSeconds: 60 * 60 * 1000, // an hour\n  store: 'local',\n  storeKey: 'MEMENTO_KEY',\n  paths: [\n    {\n      methods: [\"GET\", \"POST\"],\n      path: \"comments/*\",\n      store: \"session\",\n    },\n    {\n      methods: [\"GET\"],\n      path: \"users/1\",\n      storeKey: \"MEMENTO_USERS_2\",\n      expireTimeAsMilliSeconds: 24 * 60 * 60 * 1000, // a day\n\n    },\n    {\n      methods: [\"GET\"],\n      path: \"users/2\",\n      storeKey: \"MEMENTO_USERS_2\",\n      expireTimeAsMilliSeconds: 24 * 60 * 60 * 1000, // a day\n    },\n    {\n      methods: [\"GET\"],\n      path: \"users/*\",\n      storeKey: \"MEMENTO_USERS\",\n    },\n    {\n      methods: [\"GET\"],\n      path: \"posts\",\n      store: \"none\",\n    },\n  ],\n};\n\n/* MODULE-BASED ARCHITECTURE */\n@NgModule({\n  declarations: [],\n  imports: [\n    ...,\n    NgMementoModule.forRoot(config),\n  ],\n  providers: [],\n  bootstrap: [],\n})\nexport class AppModule {}\n\n/* STANDALONE ARCHITECTURE */\nexport const appConfig: ApplicationConfig = {\n  providers: [\n    ...,\n    importProvidersFrom(\n      NgMementoModule.forRoot(config),\n    ),\n  ],\n};\n```\n\n### Types\n\n#### IMementoConfig\n\n| property                   | type                       | default       | required | description                                            |\n| :------------------------- | :------------------------- | :------------ | :------- | :----------------------------------------------------- |\n| `expireTimeAsMilliSeconds` | `number`                   |               | ✓        | cached data stored time                                |\n| `paths`                    | `IMethodPath`              |               | ✓        |                                                        |\n| `store`                    | `none`, `local`, `session` | `none`        | x        | none: cached data stored lives only until next refresh |\n| `storeKey`                 | `string`                   | `MEMENTO_KEY` | x        | key that stores data if chose local or session         |\n\n#### IMethodPath\n\n| property                   | type                       | default      | required | description                                                                  |\n| :------------------------- | :------------------------- | :----------- | :------- | :--------------------------------------------------------------------------- |\n| `methods`                  | `MethodType`               |              | ✓        | methods to be cached                                                         |\n| `path`                     | `string`                   |              | ✓        | path to be cached **(if path ends with '/\\*' all sub paths will be cached)** |\n| `expireTimeAsMilliSeconds` | `number`                   | parent value | x        | cached data stored time                                                      |\n| `store`                    | `none`, `local`, `session` | parent value | x        | none: cached data stored lives only until next refresh                       |\n| `storeKey`                 | `string`                   | parent value | x        | key that stores data if chose local or session                               |\n\n#### MethodType\n\n| property     | type                            | default | required | description          |\n| :----------- | :------------------------------ | :------ | :------- | :------------------- |\n| `MethodType` | `\"GET\", \"POST\", \"PUT\", \"PATCH\"` |         | ✓        | methods to be cached |\n\n### Important\n\n**You should use MethodType carefully. You send same header, body, params and path when you use POST, PUT and PATCH method, ng-memento will prevent the request therefore the data will not affect.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterzurumluoglu%2Fng-memento","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterzurumluoglu%2Fng-memento","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterzurumluoglu%2Fng-memento/lists"}