Skip to content

Instantly share code, notes, and snippets.

Avatar

Ramin Hazegh rhazegh

View GitHub Profile
@bvaughn
bvaughn / updating-external-data-when-props-changes-using-promises.js
Last active Mar 27, 2021
Example for loading new external data in response to updated props
View updating-external-data-when-props-changes-using-promises.js
// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_currentId = null;
state = {
externalData: null
};
View clear-sidekiq-jobs.sh
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear