WebStorm
emoji - Ctrl+Cmd+Space MacOS
multiselect - Ctrl + G MacOS
| import React from "react"; | |
| const useDebounce = (callbackFn: () => any | Promise<any> , timeout: number = 500) => { | |
| const [sends, setSends] = React.useState(0); | |
| const debounceRequest = () => { | |
| setSends(sends + 1); | |
| }; | |
| React.useEffect(() => { |
| const ResourceEditWrapper = () => { | |
| const query = useQuery(); | |
| const classes = useStyles({}); | |
| // Resource | |
| const { | |
| resource, | |
| isLoading: isResourceLoading, |
| React.useEffect(() => { | |
| setLoading(true); | |
| const source = axios.CancelToken.source(); | |
| async function fetchData() { | |
| try { | |
| // Get all the Category content areas & topics | |
| const dataAccess = new DataAccess.Client(props.user); |
| updateState({target}) { | |
| this.setState(prevState => { | |
| return { | |
| user: { | |
| ...prevState.user, | |
| [target.name]: target.value, | |
| address: { | |
| // first lay out all the properties within the address object | |
| ...prevState.user.address, | |
| // now, overwrite the properties that need to be overwritten... |
| updateState({target}) { | |
| this.setState((prevState) => { | |
| const updatedUser = {...prevState.user, [target.name]: target.value}; // use previous value in state to build new state... | |
| return { user: updatedUser }; // And what I return here will be set as the new state | |
| }, () => this.doSomething(this.state.user); // Now I can safely utilize the new state I've created to call other funcs... | |
| ); | |
| } |
WebStorm
emoji - Ctrl+Cmd+Space MacOS
multiselect - Ctrl + G MacOS
| int main() | |
| { | |
| return 0; | |
| } | |
| class Fraction | |
| { |
| public T GetOrSet<T>(string cacheKey, Func<T> getItemCallback) where T : class | |
| { | |
| T item = MemoryCache.Default.Get(cacheKey) as T; | |
| int duration; | |
| if (ConfigurationManager.AppSettings["InMemoryCacheDuration"] == null || | |
| !Int32.TryParse(ConfigurationManager.AppSettings["InMemoryCacheDuration"], out duration)) | |
| duration = 30; |
| .factory("dataService", ["$http", "$q", function ($http, $q) { | |
| var _ratingEntities = []; | |
| var _getRatingEntities = function (options) { | |
| var deferred = $q.defer(); | |
| $http.get("api/RatingEntityProfileApi?currentPage=" + options.currentPage + "&" + "recordPerPage=" + options.recordsPerPage | |
| + "&" + "sortKey=" + options.sortKey + "&" |