Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offline api #2

Open
criloz opened this issue Apr 21, 2017 · 4 comments
Open

offline api #2

criloz opened this issue Apr 21, 2017 · 4 comments

Comments

@criloz
Copy link
Member

criloz commented Apr 21, 2017

@Ignusmart

for now implement the offline api with a class

 class Offline

it has a method called query that should be similar to this

offline = Offline (hashmap)
query(app:string, pattern:string, function( [elements], [newelement], prevResult) result{})

the query method should return an observable,

[elements] is the list of element that match the pattern in the app,
when new elements are stored in the hahmap [newelement] should contain them,

prevResult is the previus result of the query

result is the result of the function wraped in a observable.

there is a hashmap per app

@Ignusmart
Copy link
Contributor

Ignusmart commented Apr 21, 2017

@criloz can you please answer to me this question, is the function( [elements], [newelement], prevResult) a callback ? I mean, is that function a param of the query function?

@criloz
Copy link
Member Author

criloz commented Apr 21, 2017

@Ignusmart yes is a callback each time that a new element is added to the hashmap and match the pattern that function should be called.

@criloz
Copy link
Member Author

criloz commented Apr 21, 2017

@Ignusmart also you will need to finish this task first to know if a new insertion match the x pattern

nebtex/hashmaps#1

you should do what it says

@criloz
Copy link
Member Author

criloz commented Apr 21, 2017

@Ignusmart but first see waht it receive in the change object please check the mobx documentation for that,

you can use autorun, or add an observer to the hasmap add or delete x, key and see how is being called the callback that you put in the observe function try to see if you can use those values in mini match for match the pattern.,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants