{"id":16182297,"url":"https://github.com/avraammavridis/redux-perf-middleware","last_synced_at":"2025-03-16T10:31:40.218Z","repository":{"id":57351172,"uuid":"49667111","full_name":"AvraamMavridis/redux-perf-middleware","owner":"AvraamMavridis","description":"Redux performance middleware, Measure the time that the actions need to change the state","archived":false,"fork":false,"pushed_at":"2018-11-07T00:24:04.000Z","size":96,"stargazers_count":52,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-25T07:44:07.552Z","etag":null,"topics":["adheres","measure","middleware","react","redux","redux-perf-middleware"],"latest_commit_sha":null,"homepage":"","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/AvraamMavridis.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}},"created_at":"2016-01-14T18:40:17.000Z","updated_at":"2023-05-19T01:20:10.000Z","dependencies_parsed_at":"2022-09-26T16:41:38.951Z","dependency_job_id":null,"html_url":"https://github.com/AvraamMavridis/redux-perf-middleware","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvraamMavridis%2Fredux-perf-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvraamMavridis%2Fredux-perf-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvraamMavridis%2Fredux-perf-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvraamMavridis%2Fredux-perf-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AvraamMavridis","download_url":"https://codeload.github.com/AvraamMavridis/redux-perf-middleware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814895,"owners_count":20352036,"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":["adheres","measure","middleware","react","redux","redux-perf-middleware"],"created_at":"2024-10-10T06:30:04.227Z","updated_at":"2025-03-16T10:31:39.901Z","avatar_url":"https://github.com/AvraamMavridis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redux-perf-middleware\n\n[![npm version](https://badge.fury.io/js/redux-perf-middleware.svg)](https://badge.fury.io/js/redux-perf-middleware) [![CocoaPods](https://img.shields.io/cocoapods/l/AFNetworking.svg)]()\n[![semantic-versioning](https://img.shields.io/badge/semantic%20-versioning-green.svg)]()\n\n\nMeasure the time that the actions need to change the state\n\n### Install\n[![NPM](https://nodei.co/npm/redux-perf-middleware.png?mini=true)](https://nodei.co/npm/redux-perf-middleware/)\n\n### Usage\n\n```javascript\nimport perflogger from 'redux-perf-middleware';\n\nconst createStoreWithMiddleware = applyMiddleware( perflogger )(createStore);\nconst store = createStoreWithMiddleware(reducer);\n```\n\nThis project adheres to [Semantic Versioning](http://semver.org/).\n\n\n\n### Example\n\n**Dumb Reducer**\n\n```javascript\nfunction slow(){\n  let sum;\n  for(let i = 0; i\u003c 10000; i++){\n    for(let j = 0; j\u003c 10000; j++)\n    {\n      sum = i+j;\n    }\n  }\n  return sum;\n}\n\n\nexport const Elements = function ( state = {}, action ) {\n\n  switch ( action.type )\n  {\n    case 'SLOW':\n      return slow();\n\n    default:\n      return state;\n  }\n};\n```\n\n**Dumb Component**\n\n```javascript\n import React, { Component } from 'react';\n import { connect } from 'react-redux';\n\nclass Input extends Component {\n  /**\n   * Renders the markup for the topbar\n   */\n  render() {\n    const { dispatch } = this.props;\n    return (\n        \u003cinput onKeyDown={ () =\u003e dispatch({ type: 'SLOW' })} /\u003e\n    );\n  }\n};\n\nconst selector = function( { default: elements } ){\n  return elements;\n}\n\nexport default connect(selector)( Input );\n```\n\nOn every keydown **Redux** will dispatch the action with type SLOW, and in the console the middleware will log something like:\n\n![perflogger](http://oi68.tinypic.com/2h37fqb.jpg)\n\nOr check the [sample app](https://github.com/AvraamMavridis/redux-perf-middleware/tree/master/app)\n\n## Contributing\nFeel free to open issues, make suggestions or send PRs.\nThis project adheres to the Contributor Covenant [code of conduct](http://contributor-covenant.org/). By participating, you are expected to uphold this code.\n\n## Contact\n\nTwitter: [@avraamakis](https://twitter.com/avraamakis)\n\n### License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favraammavridis%2Fredux-perf-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favraammavridis%2Fredux-perf-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favraammavridis%2Fredux-perf-middleware/lists"}