How to use the @microsoft/sp-lodash-subset.clone function in @microsoft/sp-lodash-subset

To help you get started, we’ve selected a few @microsoft/sp-lodash-subset examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SharePoint / sp-dev-fx-property-controls / src / propertyFields / collectionData / collectionDataItem / CollectionDataItem.tsx View on Github external
constructor(props: ICollectionDataItemProps) {
    super(props);

    // Create an empty item with all properties
    let emptyItem = this.generateEmptyItem();

    this.state = {
      crntItem: clone(this.props.item) || {...emptyItem},
      errorMsgs: [],
      showCallout: false
    };
  }
github SharePoint / sp-dev-fx-webparts / samples / react-search-refiners / spfx / src / services / SearchService / MockSearchService.ts View on Github external
const p1 = new Promise((resolve, reject) => {

            const filters: string[] = [];
            let searchResults = clone(this._searchResults);
            const filteredResults: ISearchResult[] = [];
            
            if (refinementFilters.length > 0) {
                refinementFilters.map((filter) => {
                    filters.push(filter.Value.RefinementToken);                                                     
                });
                
                searchResults.RelevantResults.map((searchResult) => {
                    const filtered = intersection(filters, searchResult.RefinementTokenValues.split(','));
                    if (filtered.length > 0) {
                        filteredResults.push(searchResult);
                    }
                });

                searchResults = {
                    RelevantResults: filteredResults,
github SharePoint / sp-dev-fx-webparts / samples / vuejs-todo-single-file-component / src / dataProviders / MockDataProvider.ts View on Github external
public getItems(): Promise {

    const items: ITodoItem[] = lodash.clone(this._items[this._selectedList.Id]);

    return new Promise((resolve) => {
      setTimeout(() => resolve(items), 500);
    });
  }
github SharePoint / sp-dev-fx-property-controls / src / propertyFields / collectionData / collectionDataItem / CollectionDataItem.tsx View on Github external
public componentDidUpdate(prevProps: ICollectionDataItemProps): void {
    if (this.props.item !== prevProps.item) {
      this.setState({
        crntItem: clone(this.props.item)
      });
    }
  }
github SharePoint / sp-dev-fx-controls-react / src / controls / fields / fieldUserRenderer / FieldUserRenderer.tsx View on Github external
this.setState((prevState: IFieldUserRendererState, componentProps: IFieldUserRendererProps) => {
            const newUsers = _.clone(prevState.users);
            newUsers[index] = this._getUserFromPrincipalAndProps(this.props.users[index], userProfileProps);

            return { users: newUsers };

        });
    }