mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-10-30 02:20:08 +00:00 
			
		
		
		
	started migration of index...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									00ca03e93b
								
							
						
					
					
						commit
						e06e7b4732
					
				| @ -190,10 +190,11 @@ module.BaseStore = { | |||||||
| 				&& data.splice(data.indexOf(path), 1) | 				&& data.splice(data.indexOf(path), 1) | ||||||
| 			return data }, }), | 			return data }, }), | ||||||
| 	// XXX should this clone the data???
 | 	// XXX should this clone the data???
 | ||||||
|  | 	// XXX should we use 'lazy'???
 | ||||||
| 	get xpaths(){ | 	get xpaths(){ | ||||||
| 		return this.__xpaths() }, | 		return this.__xpaths() }, | ||||||
| 
 | 
 | ||||||
| 	// NOTE: this is build from .paths so there is no need to define a 
 | 	// NOTE: this is built from .paths so there is no need to define a 
 | ||||||
| 	// 		way to merge...
 | 	// 		way to merge...
 | ||||||
| 	__xnames: index.makeIndex('xnames',  | 	__xnames: index.makeIndex('xnames',  | ||||||
| 		function(){ | 		function(){ | ||||||
| @ -224,6 +225,7 @@ module.BaseStore = { | |||||||
| 				&& (delete data[n]) | 				&& (delete data[n]) | ||||||
| 			return data }, }), | 			return data }, }), | ||||||
| 	// XXX should this clone the data???
 | 	// XXX should this clone the data???
 | ||||||
|  | 	// XXX should we use 'lazy'???
 | ||||||
| 	get xnames(){ | 	get xnames(){ | ||||||
| 		return this.__xnames() }, | 		return this.__xnames() }, | ||||||
| 
 | 
 | ||||||
| @ -335,7 +337,9 @@ module.BaseStore = { | |||||||
| 		var {path, args} = pwpath.splitArgs(path) | 		var {path, args} = pwpath.splitArgs(path) | ||||||
| 		args = pwpath.joinArgs('', args) | 		args = pwpath.joinArgs('', args) | ||||||
| 		// build list of existing page candidates...
 | 		// build list of existing page candidates...
 | ||||||
| 		var names = await this.names() | 		//var names = await this.names()
 | ||||||
|  | 		// XXX INDEX
 | ||||||
|  | 		var names = await this.xnames | ||||||
| 		var pages = new Set( | 		var pages = new Set( | ||||||
| 			pwpath.names(path) | 			pwpath.names(path) | ||||||
| 				.map(function(name){ | 				.map(function(name){ | ||||||
| @ -591,6 +595,8 @@ module.BaseStore = { | |||||||
| 		await this.__update__(path, data, mode) | 		await this.__update__(path, data, mode) | ||||||
| 		// XXX CACHED
 | 		// XXX CACHED
 | ||||||
| 		this.__cache_add(path) | 		this.__cache_add(path) | ||||||
|  | 		// XXX INDEX
 | ||||||
|  | 		this.index('update', path) | ||||||
| 		this.onUpdate(path) | 		this.onUpdate(path) | ||||||
| 		return this }, | 		return this }, | ||||||
| 	__delete__: async function(path){ | 	__delete__: async function(path){ | ||||||
| @ -605,6 +611,8 @@ module.BaseStore = { | |||||||
| 			await this.__delete__(path) | 			await this.__delete__(path) | ||||||
| 			// XXX CACHED
 | 			// XXX CACHED
 | ||||||
| 			this.__cache_remove(path)  | 			this.__cache_remove(path)  | ||||||
|  | 			// XXX INDEX
 | ||||||
|  | 			this.index('remove', path) | ||||||
| 			this.onDelete(path) } | 			this.onDelete(path) } | ||||||
| 		return this }, | 		return this }, | ||||||
| 
 | 
 | ||||||
| @ -844,6 +852,8 @@ module.MetaStore = { | |||||||
| 				path.slice(path.indexOf(p)+p.length), | 				path.slice(path.indexOf(p)+p.length), | ||||||
| 				...[...arguments].slice(1)) | 				...[...arguments].slice(1)) | ||||||
| 			this.__cache_add(path) | 			this.__cache_add(path) | ||||||
|  | 			// XXX INDEX
 | ||||||
|  | 			this.index('update', path) | ||||||
| 			return this } | 			return this } | ||||||
| 		// add local...
 | 		// add local...
 | ||||||
| 		return object.parentCall(MetaStore.update, this, ...arguments) }, | 		return object.parentCall(MetaStore.update, this, ...arguments) }, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user